sum256_bytes
pub fn sum256_bytes(s string) stringPurpose
Sum256 bytes.
Parameters
sstring- source string (string)
Returns
string — result string
#crypto/sha256SHA-256: hex and raw bytes + Digest.
sum256_bytespub fn sum256_bytes(s string) stringSum256 bytes.
s stringstring — result string
sum256pub fn sum256(s string) stringCompute a digest (often lowercase hex).
s stringstring — result string
struct Digestpub struct Digest {
}Sha256 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) sum_bytespub fn (d &Digest) sum_bytes() stringOperation on &Digest: compute a raw-byte digest.
d &DigestDigest instance used by this call (borrow).string — result string
(&Digest) clonepub fn (d &Digest) clone() DigestOperation on &Digest: copy into a new independent string.
d &DigestDigest instance used by this call (borrow).Digest — 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
(&Digest) sum_padded32pub fn (d &Digest) sum_padded32(msg32 &string) stringsum_padded32 hashes a 32-byte message after an already-block-aligned Digest (e.g. an HMAC ipad/opad midstate) without allocating a fresh Digest.
d &DigestDigest instance used by this call (borrow).msg32 &stringstring — result string