Skip to content

Digest

[Source]

Produces a hash from the chunks of input. Feed the input with append() and produce a final hash from the concatenation of the input with final().

class ref Digest

Constructors

md5

[Source]

Use the MD5 algorithm to calculate the hash.

new ref md5()
: Digest ref^

Returns


ripemd160

[Source]

Use the RIPEMD160 algorithm to calculate the hash.

new ref ripemd160()
: Digest ref^

Returns


sha1

[Source]

Use the SHA1 algorithm to calculate the hash.

new ref sha1()
: Digest ref^

Returns


sha224

[Source]

Use the SHA256 algorithm to calculate the hash.

new ref sha224()
: Digest ref^

Returns


sha256

[Source]

Use the SHA256 algorithm to calculate the hash.

new ref sha256()
: Digest ref^

Returns


sha384

[Source]

Use the SHA384 algorithm to calculate the hash.

new ref sha384()
: Digest ref^

Returns


sha512

[Source]

Use the SHA512 algorithm to calculate the hash.

new ref sha512()
: Digest ref^

Returns


Public Functions

append

[Source]

Update the Digest object with input. Throw an error if final() has been called.

fun ref append(
  input: (String val | Array[U8 val] val))
: None val ?

Parameters

Returns


final

[Source]

Return the digest of the strings passed to the append() method.

fun ref final()
: Array[U8 val] val

Returns


digest_size

[Source]

Return the size of the message digest in bytes.

fun box digest_size()
: USize val

Returns