jon.recoil.org

Module Digest.BLAKE128Source

BLAKE128 is the BLAKE2b hash function producing 128-bit (16-byte) digests. It is cryptographically secure. However, the small size of the digests enables brute-force attacks in 2{^64} attempts.

Sourcetype t = string

The type of digests.

Sourceval hash_length : int

The length of digests, in bytes.

Compare two digests, with the same specification as Stdlib.compare.

Test two digests for equality.

Sourceval string : string -> Stdlib.Digest.BLAKE128.t

Return the digest of the given string.

Sourceval bytes : bytes -> Stdlib.Digest.BLAKE128.t

Return the digest of the given byte sequence.

Sourceval substring : string -> int -> int -> Stdlib.Digest.BLAKE128.t

substring s ofs len returns the digest of the substring of s starting at index ofs and containing len characters.

Sourceval subbytes : bytes -> int -> int -> Stdlib.Digest.BLAKE128.t

subbytes s ofs len returns the digest of the subsequence of s starting at index ofs and containing len bytes.

Read characters from the channel and return their digest. See Digest.channel for the full specification.

Sourceval file : string -> Stdlib.Digest.BLAKE128.t

Return the digest of the file whose name is given.

Write a digest on the given output channel.

Read a digest from the given input channel.

Sourceval to_hex : Stdlib.Digest.BLAKE128.t -> string

Return the printable hexadecimal representation of the given digest.

Sourceval of_hex : string -> Stdlib.Digest.BLAKE128.t

Convert a hexadecimal representation back into the corresponding digest.

  • raises Invalid_argument

    if the length of the argument is not 2 * hash_length, or if the arguments contains non-hexadecimal characters.