Skip to content

Commit c3ee4fb

Browse files
committed
crypto: make public all Digest.checksum() methods
1 parent 3b36f16 commit c3ee4fb

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

vlib/crypto/sha1/sha1.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ pub fn (d &Digest) sum(b_in []byte) []byte {
102102
return b_out
103103
}
104104

105-
// checksum returns the byte checksum of the `Digest`.
106-
fn (mut d Digest) checksum() []byte {
105+
// checksum returns the current byte checksum of the `Digest`.
106+
pub fn (mut d Digest) checksum() []byte {
107107
mut len := d.len
108108
// Padding. Add a 1 bit and 0 bits until 56 bytes mod 64.
109109
mut tmp := []byte{len: (64)}

vlib/crypto/sha256/sha256.v

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ pub fn (d &Digest) sum(b_in []byte) []byte {
142142
return b_out
143143
}
144144

145-
fn (mut d Digest) checksum() []byte {
145+
// checksum returns the current byte checksum of the Digest.
146+
pub fn (mut d Digest) checksum() []byte {
146147
mut len := d.len
147148
// Padding. Add a 1 bit and 0 bits until 56 bytes mod 64.
148149
mut tmp := []byte{len: (64)}

vlib/crypto/sha512/sha512.v

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ pub fn (d &Digest) sum(b_in []byte) []byte {
214214
return b_out
215215
}
216216

217-
fn (mut d Digest) checksum() []byte {
217+
// checksum returns the current byte checksum of the Digest.
218+
pub fn (mut d Digest) checksum() []byte {
218219
// Padding. Add a 1 bit and 0 bits until 112 bytes mod 128.
219220
mut len := d.len
220221
mut tmp := []byte{len: (128)}

0 commit comments

Comments
 (0)