package octez-proto-libs
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/octez-proto-libs.protocol-environment/Tezos_protocol_environment/V0/Make/MBytes/index.html
Module Make.MBytesSource
val create : int -> tval length : t -> intsub src ofs len extract a sub-array of src starting at ofs and of length len. No copying of elements is involved: the sub-array and the original array share the same storage space.
blit src ofs_src dst ofs_dst len copy len bytes from src starting at ofs_src into dst starting at ofs_dst.
val blit_of_string : string -> int -> t -> int -> int -> unitSee blit
val blit_to_bytes : t -> int -> bytes -> int -> int -> unitSee blit
val of_string : string -> tof_string s create an byte array filled with the same content than s.
val to_string : t -> stringto_string b dump the array content in a string.
val sub_string : t -> int -> int -> stringsub_string b ofs len is equivalent to to_string (sub b ofs len).
Functions reading and writing bytes
val get_char : t -> int -> charget_char buff i reads 1 byte at offset i as a char
val get_uint8 : t -> int -> intget_uint8 buff i reads 1 byte at offset i as an unsigned int of 8 bits. i.e. It returns a value between 0 and 2^8-1
val get_int8 : t -> int -> intget_int8 buff i reads 1 byte at offset i as a signed int of 8 bits. i.e. It returns a value between -2^7 and 2^7-1
val set_char : t -> int -> char -> unitset_char buff i v writes v to buff at offset i
val set_int8 : t -> int -> int -> unitset_int8 buff i v writes the least significant 8 bits of v to buff at offset i
Functions reading according to Big Endian byte order
val get_uint16 : t -> int -> intget_uint16 buff i reads 2 bytes at offset i as an unsigned int of 16 bits. i.e. It returns a value between 0 and 2^16-1
val get_int16 : t -> int -> intget_int16 buff i reads 2 byte at offset i as a signed int of 16 bits. i.e. It returns a value between -2^15 and 2^15-1
val get_int32 : t -> int -> int32get_int32 buff i reads 4 bytes at offset i as an int32.
val get_int64 : t -> int -> int64get_int64 buff i reads 8 bytes at offset i as an int64.
val set_int16 : t -> int -> int -> unitset_int16 buff i v writes the least significant 16 bits of v to buff at offset i
val set_int32 : t -> int -> int32 -> unitset_int32 buff i v writes v to buff at offset i
val set_int64 : t -> int -> int64 -> unitset_int64 buff i v writes v to buff at offset i
module LE : sig ... endFunctions reading according to Little Endian byte order
val to_hex : t -> [ `Hex of string ]val of_hex : [ `Hex of string ] -> t