Digest.BLAKE128(3) OCaml library Digest.BLAKE128(3)

# [NAME](#NAME)

Digest.BLAKE128 - BLAKE128 is the BLAKE2b hash function producing 128-bit (16-byte) digests.

# [Module](#Module)

Module Digest.BLAKE128

# [Documentation](#Documentation)

Module **BLAKE128**  
: **S**

**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.

**Since** 5.2

*type t* = **string**

The type of digests.

*val hash\_length* : **int**

The length of digests, in bytes.

*val compare* : **t -&gt; t -&gt; int**

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

*val equal* : **t -&gt; t -&gt; bool**

Test two digests for equality.

*val string* : **string -&gt; t**

Return the digest of the given string.

*val bytes* : **bytes -&gt; t**

Return the digest of the given byte sequence.

*val substring* : **string -&gt; int -&gt; int -&gt; t**

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

*val subbytes* : **bytes -&gt; int -&gt; int -&gt; t**

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

*val channel* : **in\_channel -&gt; int -&gt; t**

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

*val file* : **string -&gt; t**

Return the digest of the file whose name is given.

*val output* : **out\_channel -&gt; t -&gt; unit**

Write a digest on the given output channel.

*val input* : **in\_channel -&gt; t**

Read a digest from the given input channel.

*val to\_hex* : **t -&gt; string**

Return the printable hexadecimal representation of the given digest.

**Raises Invalid\_argument** if the length of the argument is not **hash\_length** ,

*val of\_hex* : **string -&gt; 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.

2026-10-01 OCamldoc

---

Document: Digest.BLAKE128(3o) from ocaml 5.5.1-r1 (Chainguard OS)
Source: https://github.com/ocaml/ocaml
