Bigcrypto.BytesThe module for bytes.
type t = bigbytesThe type for byte buffers.
val create : int -> init:int -> tcreate n ~init is a byte buffer of length n filled with byte init.
val init : int -> init:( int -> int ) -> tinit n ~init is a byte bufer of length n with init i called to initialize index i.
val length : t -> intlength b is the length of b.
val get : t -> int -> intget b i is the byte at index i of b.
val set : t -> int -> int -> unitset b i v sets the byte at index i of b to v.
val clear : t -> unitclear b fills b with 0.
blit ~src i ~dst k ~len copies the len bytes of src starting at i to those of dst starting at k.
val of_string : string -> tof_string s are the bytes of s.
val to_string : t -> stringto_string b are the bytes of b as a string.
val of_bytes : bytes -> tof_bytes b are the bytes of b.
val to_bytes : t -> bytesto_bytes b are the bytes of b as bytes.
The type for textual hexadecimal conversion errors.
val hex_error_message : hex_error -> stringhex_error_message e is an english error message for e.
of_hex s parses bytes from s. Drops space (U+0020) or minus (U+002D) characters and then parses any even sequence of US-ASCII upper or lowercase hexadecimal digits (U+0030–0+0039, U+0041–U+0046, U+0061-U+0066) into a byte sequence.
val of_hex' : string -> ( t, string ) Stdlib.resultof_hex' s is Result.map_error hex_error_message (of_hex s).
val to_hex : ?sep:char -> t -> stringto_hex ?sep b formats b as lowercase hexadecimal digits with bytes separated by sep (if provided; use either ' ' or '-' if you want to round trip with of_hex).
val pp : Stdlib.Format.formatter -> t -> unitpp formats bytes in lowercased hex with a space between each byte.