sum256
pub fn sum256(s string) stringPurpose
Compute a digest (often lowercase hex).
Parameters
sstring- source string (string)
Returns
string — result string
#crypto/sha3SHA-3 / SHAKE.
sum256pub fn sum256(s string) stringCompute a digest (often lowercase hex).
s stringstring — result string
shake_sum128pub fn shake_sum128(data &string, n int) stringCompute SHAKE-128 extendable-output hash digest.
data &stringn intstring — result string
shake_sum128_checkedpub fn shake_sum128_checked(data &string, n int) stringShake sum128 checked. Throws on failure; handle the error or propagate it to the caller.
data &stringn intstring — result string
struct Digestpub struct Digest {
}Sha3 Cryptographic hash digest state context.
This type has no public fields.
new256pub fn new256() DigestCreate 256-bit hash or HMAC digest context.
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