crypto.sha256: add missing documentation of sum (#12716)

pull/12723/head
Taillook 2021-12-05 03:16:44 +09:00 committed by GitHub
parent 81a1490e31
commit 4b21d3e364
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -124,6 +124,7 @@ fn (mut d Digest) write(p_ []byte) ?int {
} }
} }
// sum returns the SHA256 or SHA224 checksum of digest with the data.
pub fn (d &Digest) sum(b_in []byte) []byte { pub fn (d &Digest) sum(b_in []byte) []byte {
// Make a copy of d so that caller can keep writing and summing. // Make a copy of d so that caller can keep writing and summing.
mut d0 := *d mut d0 := *d