mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
crypto.md5: fix calculating the same hash values, when .sum() is called several times (#19703)
This commit is contained in:
parent
00bf5c4a16
commit
395b55f0cf
5 changed files with 28 additions and 6 deletions
|
@ -167,7 +167,10 @@ pub fn (d &Digest) sum(b_in []u8) []u8 {
|
|||
return b_out
|
||||
}
|
||||
|
||||
// checksum returns the current byte checksum of the Digest.
|
||||
// checksum returns the current byte checksum of the Digest,
|
||||
// it is an internal method and is not recommended because its results are not idempotent.
|
||||
[deprecated: 'checksum() will be changed to a private method, use sum() instead']
|
||||
[deprecated_after: '2024-04-30']
|
||||
pub fn (mut d Digest) checksum() []u8 {
|
||||
mut len := d.len
|
||||
// Padding. Add a 1 bit and 0 bits until 56 bytes mod 64.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue