package octez-proto-libs

  1. Overview
  2. Docs
Octez protocol libraries

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-18.0.tar.gz
sha256=dbc3b675aee59c2c574e5d0a771193a2ecfca31e7a5bc5aed66598080596ce1c
sha512=b97ed762b9d24744305c358af0d20f394376b64bfdd758dd4a81775326caf445caa57c4f6445da3dd6468ff492de18e4c14af6f374dfcbb7e4d64b7b720e5e2a

doc/octez-proto-libs.protocol-environment/Tezos_protocol_environment/V9/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.