package octez-proto-libs

  1. Overview
  2. Docs
Octez protocol libraries

Install

Dune Dependency

Authors

Maintainers

Sources

octez-19.0.tar.gz
sha256=c6df840ebbf115e454db949028c595bec558a59a66cade73b52a6d099d6fa4d4
sha512=d8aee903b9fe130d73176bc8ec38b78c9ff65317da3cb4f3415f09af0c625b4384e7498201fdb61aa39086a7d5d409d0ab3423f9bc3ab989a680cf444a79bc13

doc/octez-proto-libs.protocol-environment/Tezos_protocol_environment/V11/Make/Data_encoding/Bounded/index.html

Module Data_encoding.Bounded

val string : ?length_kind:[ `N | `Uint30 | `Uint16 | `Uint8 ] -> string_json_repr -> int -> string encoding

Encoding of a string whose length does not exceed the specified length.

If length_kind is set, then it is used to encode the length of the string in a header. If length_kind is omitted then the length field uses the smallest fixed-width 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.

  • raises Invalid_argument

    if length_kind is set but it cannot accommodate the specified bound. E.g., Bounded.string ~length_kind:`Uint8 Hex 1000 raises.

  • raises Invalid_argument

    if length_kind is unset and the specified bound is larger than 2^30.

val bytes : ?length_kind:[ `N | `Uint30 | `Uint16 | `Uint8 ] -> string_json_repr -> int -> Bytes.t encoding

See string above.

OCaml

Innovation. Community. Security.