mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
crypto.sha: fix calculating the same hash values when .sum() is called several times for sha1/256/512 (fix #19696) (#19697)
This commit is contained in:
parent
109fc22269
commit
ac40981bcc
6 changed files with 38 additions and 6 deletions
|
@ -11,7 +11,9 @@ fn test_crypto_sha1_writer() {
|
|||
mut digest := sha1.new()
|
||||
digest.write('This is a'.bytes()) or { assert false }
|
||||
digest.write(' sha1 checksum.'.bytes()) or { assert false }
|
||||
sum := digest.sum([])
|
||||
mut sum := digest.sum([])
|
||||
assert sum.hex() == 'e100d74442faa5dcd59463b808983c810a8eb5a1'
|
||||
sum = digest.sum([])
|
||||
assert sum.hex() == 'e100d74442faa5dcd59463b808983c810a8eb5a1'
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue