crypto: make Digest.sum() and Digest.write() private in md5 and sha1 (#8270)

pull/8276/head
Larpon 2021-01-22 14:14:31 +01:00 committed by GitHub
parent 500ebf77e4
commit f2c6735d92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -51,7 +51,7 @@ pub fn new() &Digest {
return d
}
pub fn (mut d Digest) write(p_ []byte) int {
fn (mut d Digest) write(p_ []byte) int {
unsafe {
mut p := p_
nn := p.len
@ -85,7 +85,7 @@ pub fn (mut d Digest) write(p_ []byte) int {
}
}
pub fn (d &Digest) sum(b_in []byte) []byte {
fn (d &Digest) sum(b_in []byte) []byte {
// Make a copy of d so that caller can keep writing and summing.
mut d0 := *d
hash := d0.checksum()

View File

@ -55,7 +55,7 @@ pub fn new() &Digest {
}
[manualfree]
pub fn (mut d Digest) write(p_ []byte) int {
fn (mut d Digest) write(p_ []byte) int {
nn := p_.len
unsafe {
mut p := p_
@ -89,7 +89,7 @@ pub fn (mut d Digest) write(p_ []byte) int {
return nn
}
pub fn (d &Digest) sum(b_in []byte) []byte {
fn (d &Digest) sum(b_in []byte) []byte {
// Make a copy of d so that caller can keep writing and summing.
mut d0 := *d
hash := d0.checksum()