Module Hash.PrefixSource

Sourcetype t

Type of the prefix part of hash. The length is not fixed in this implementation.

Please note that there is no typing guarantee to prevent merging different size of hashes.

Sourceval to_string : t -> string

Get the bytes bytes binary string representation of t.

Sourceval of_string : string -> t

bytes bytes binary string representation to t. Note: no check of length.

Sourceval length : t -> int
Sourceval overwrite_last_2bits : t -> int -> t
Sourceval zero : int -> t

zero n returns n bytes of zeros

Sourceval to_hex_string : t -> string

Convert to bytes * 2 chars of hexdigits

Sourceval of_hex_string : string -> t

Reverse of to_hex_string. Fails if the string is inappropriate.

Sourceval show_ref : (t -> string) ref
Sourceval show : t -> string
Sourceval pp : Format.formatter -> t -> unit
Sourceval encoding : int -> t Data_encoding.t

Encoding: fixed length bytes. The size is given as the argument.

Sourceval gen : int -> t Gen.t
Sourceval to_32byte_string : t -> string