June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -1,13 +1,10 @@
|
|||
clear = "Rosetta code"
|
||||
standard = "764faf5c61ac315f1497f9dfa542713965b785e5cc2f707d6468d7d1124cdfcf"
|
||||
msg = "Rosetta code"
|
||||
|
||||
using Nettle
|
||||
digest = hexdigest("sha256", msg)
|
||||
|
||||
# native
|
||||
using SHA
|
||||
digest1 = join(num2hex.(sha256(msg)))
|
||||
|
||||
crypt = join(map(hex, sha256("Rosetta code")))
|
||||
|
||||
println("Testing Julia's SHA-256:")
|
||||
if crypt == standard
|
||||
println(" OK, \"", clear, "\" => ", crypt)
|
||||
else
|
||||
println("The hash does not match the standard value.")
|
||||
end
|
||||
@assert digest == digest1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue