Module Bytesrw_crypto.Bigbytes

Bigbytes operations.

type t = bigbytes

The type for bigbytes.

val create : int -> bigbytes

create n are n uninitialized bytes.

val make : int -> fill:uint8 -> bigbytes

make n ~fill is bigbytes of length n initalized with byte fill.

val init : int -> (int -> uint8) -> t

init n init is a bigbytes of length n with element i initialized by init i.

val length : bigbytes -> int

length b is the length of b.

val copy : bigbytes -> bigbytes

copy b is a copy of b.

Converting

val of_string : string -> bigbytes

of_string s is a bigbytes value with the contents of s.

val to_string : ?length:int -> bigbytes -> string

to_string b is a string with the first length bytes of b. length defaults to length b.

val of_bytes : bytes -> bigbytes

of_bytes s is a bigbytes value with the contents of s.

val to_bytes : ?length:int -> bigbytes -> bytes

to_bytes b is a bytes value with the first length bytes of b. length defaults to length b.

Formatting

val pp : Stdlib.Format.formatter -> t -> unit

pp formats bigbytes for inspection.