package data-encoding

  1. Overview
  2. Docs
val string : int -> string encoding

Encoding of a string whose length does not exceed the specified length. The size field uses the smallest integer that can accommodate the maximum size - e.g., `Uint8 for very short strings, `Uint16 for longer strings, etc.

Attempting to construct a string with a length that is too long causes an Invalid_argument exception.

val bytes : int -> Stdlib.Bytes.t encoding

See string above.