diff --git a/vlib/crypto/sha1/sha1.v b/vlib/crypto/sha1/sha1.v index b7a80f3af0..04678f7822 100644 --- a/vlib/crypto/sha1/sha1.v +++ b/vlib/crypto/sha1/sha1.v @@ -102,8 +102,8 @@ pub fn (d &Digest) sum(b_in []byte) []byte { return b_out } -// checksum returns the byte checksum of the `Digest`. -fn (mut d Digest) checksum() []byte { +// checksum returns the current byte checksum of the `Digest`. +pub fn (mut d Digest) checksum() []byte { mut len := d.len // Padding. Add a 1 bit and 0 bits until 56 bytes mod 64. mut tmp := []byte{len: (64)} diff --git a/vlib/crypto/sha256/sha256.v b/vlib/crypto/sha256/sha256.v index 76be52e314..e8bd91833c 100644 --- a/vlib/crypto/sha256/sha256.v +++ b/vlib/crypto/sha256/sha256.v @@ -142,7 +142,8 @@ pub fn (d &Digest) sum(b_in []byte) []byte { return b_out } -fn (mut d Digest) checksum() []byte { +// checksum returns the current byte checksum of the Digest. +pub fn (mut d Digest) checksum() []byte { mut len := d.len // Padding. Add a 1 bit and 0 bits until 56 bytes mod 64. mut tmp := []byte{len: (64)} diff --git a/vlib/crypto/sha512/sha512.v b/vlib/crypto/sha512/sha512.v index 6a22ee7d26..6327ab3fe9 100644 --- a/vlib/crypto/sha512/sha512.v +++ b/vlib/crypto/sha512/sha512.v @@ -214,7 +214,8 @@ pub fn (d &Digest) sum(b_in []byte) []byte { return b_out } -fn (mut d Digest) checksum() []byte { +// checksum returns the current byte checksum of the Digest. +pub fn (mut d Digest) checksum() []byte { // Padding. Add a 1 bit and 0 bits until 112 bytes mod 128. mut len := d.len mut tmp := []byte{len: (128)}