Module CustomizedMake.Encoding
Conversions back and forth between various encodings like hexadecimal.
type t= tThe type that will be used to represent contiguous bytes; typically either Bytes.t or Cstruct.t
type t_elem= t_elemThe type that will be used to represent a single byte
val b2h : t_elem -> tb2h cconverts a bytecinto a 2-byte buffer filled with the hexadecimal octet ofc.- raises Encoding_failure
for any failure
val hexStringTo32ByteArray : t -> thexStringTo32ByteArray hextakes a bufferhexof a hexadecimal text of least length 64 and then converts it to the 32 bytes the hexadecimal octets represents.This function signature looks odd because it doesn't take in a string. Since ProScript -> OCaml auto-translation must convert all strings immediately into buffers because the translator can't deduce when it is appropriate to use strings or buffers, your code needs to do use buffers consistently as well.
- raises Encoding_failure
for any failure
val hexStringTo12ByteArray : t -> thexStringTo12ByteArray hextakes a bufferhexof a hexadecimal text of at least length 24 and then converts it to the 12 bytes the hexadecimal octets represents.This function signature looks odd because it doesn't take in a string. Since ProScript -> OCaml auto-translation must convert all strings immediately into buffers because the translator can't deduce when it is appropriate to use strings or buffers, your code needs to do use buffers consistently as well.
- raises Encoding_failure
for any failure