4
* Testing the Hashlib.sha256() and Hashlib.verify() methods
9
var hash = Hashlib.sha256("Dictu");
11
assert(type(hash) == "string");
12
assert(hash.len() == 64);
13
assert(hash == "889bb2f43047c331bed74b1a9b309cc66adff6c6d4c3517547813ad67ba8d105");
15
assert(Hashlib.verify(hash, Hashlib.sha256("Dictu")));
16
assert(Hashlib.verify(Hashlib.sha256("Dictu"), hash));
17
assert(Hashlib.verify(hash, "WRONG!") == false);
18
assert(Hashlib.verify(Hashlib.sha256("Dictu"), "WRONG!") == false);
19
assert(Hashlib.verify("WRONG", Hashlib.sha256("Dictu")) == false);
b'\\ No newline at end of file'