sum
XuAPI
pub fn sum(s string) stringPurpose
Compute a digest (often lowercase hex).
Parameters
sstring- source string (string)
Returns
string — result string
API
#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 {
}Public struct `Digest`.
none
newpub fn new() DigestConstruct a new value of this type.
none
Digest — a value of this type
(&mut Digest) writepub fn (d &mut Digest) write(p &string) intMethod on `&mut Digest`: write data and return the byte count.
d &mut Digestp &stringint — bytes written
(&mut Digest) resetpub fn (d &mut Digest) reset()Method on `&mut Digest`: clear internal state so the value can be reused.
d &mut Digest(Digest) sizepub fn (d Digest) size() intMethod on `Digest`: return the size.
d Digestint — a value of this type
(Digest) blocksizepub fn (d Digest) blocksize() intCall `blocksize` on `Digest`.
d Digestint — a value of this type
(&Digest) sumpub fn (d &Digest) sum() stringMethod on `&Digest`: compute a digest (often lowercase hex).
d &Digeststring — result string