sum
pub fn sum(s string) stringPurpose
Compute a digest (often lowercase hex).
Parameters
sstring- source string (string)
Returns
string — result string
#crypto/sha1SHA-1 digest and Digest.
sumpub fn sum(s string) stringCompute a digest (often lowercase hex).
s stringstring — result string
struct Digestpub struct Digest {
}Sha1 Cryptographic hash digest state context.
This type has no public fields.
newpub fn new() DigestConstruct a new value of this type.
No arguments are required.
Digest — a value of this type
($&Digest) writepub fn (d $&Digest) write(p &string) intOperation on $&Digest: write data and return the byte count.
d $&DigestDigest instance used by this call (exclusive borrow).p &stringint — bytes written
($&Digest) resetpub fn (d $&Digest) reset()Operation on $&Digest: clear internal state so the value can be reused.
d $&DigestDigest instance used by this call (exclusive borrow).This call does not return a value.
(Digest) sizepub fn (d Digest) size() intOperation on Digest: return the size.
d DigestDigest instance used by this call (value receiver).int — a value of this type
(Digest) blocksizepub fn (d Digest) blocksize() intReturn block size of the cipher or stream in bytes.
d DigestDigest instance used by this call (value receiver).int — a value of this type
(&Digest) sumpub fn (d &Digest) sum() stringOperation on &Digest: compute a digest (often lowercase hex).
d &DigestDigest instance used by this call (borrow).string — result string