Fixed bug with wrong line numbers in error messages. Some examples refactoring and bug fixes. (0.39.15)
This commit is contained in:
parent
53ccdbda10
commit
3d3c11496f
23 changed files with 265 additions and 114 deletions
|
|
@ -18,7 +18,7 @@
|
|||
* FUN_LIB_DIR="$(pwd)/lib" ./build/fun examples/sha1_demo.fun
|
||||
*/
|
||||
|
||||
#include <crypt/sha1.fun> as sha1
|
||||
include <crypt/sha1.fun>
|
||||
|
||||
print("=== SHA-1 demo ===")
|
||||
|
||||
|
|
@ -27,15 +27,15 @@ hex_abc = "616263" // "abc" in hex
|
|||
empty = ""
|
||||
|
||||
// Hash ASCII string directly
|
||||
d1 = sha1.SHA1().sha1_str(s)
|
||||
d1 = SHA1().sha1_str(s)
|
||||
print("SHA-1('abc') = " + d1)
|
||||
|
||||
// Hash pre-encoded hex bytes
|
||||
d2 = sha1.SHA1().sha1_hex(hex_abc)
|
||||
d2 = SHA1().sha1_hex(hex_abc)
|
||||
print("SHA-1(616263 hex) = " + d2)
|
||||
|
||||
// Empty string
|
||||
d3 = sha1.SHA1().sha1_str(empty)
|
||||
d3 = SHA1().sha1_str(empty)
|
||||
print("SHA-1('') = " + d3)
|
||||
|
||||
print("=== done ===")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue