Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
The ProScript.encoding
interface for conversions back and forth between various encodings like hexadecimal.
The type that will be used to represent contiguous bytes; typically either Bytes.t or Cstruct.t
b2h c
converts a byte c
into a 2-byte buffer filled with the hexadecimal octet of c
.
hexStringTo32ByteArray hex
takes a buffer hex
of 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.
hexStringTo12ByteArray hex
takes a buffer hex
of 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.