module Binary_packing: Binary_packing
type
endian = [ `Big_endian | `Little_endian ]
val unpack_signed_8 : buf:string -> pos:int -> int
val pack_signed_8 : buf:string -> pos:int -> int -> unit
val unpack_unsigned_8 : buf:string -> pos:int -> int
val pack_unsigned_8 : buf:string -> pos:int -> int -> unit
val unpack_signed_16 : byte_order:endian -> buf:string -> pos:int -> int
val pack_signed_16 : byte_order:endian -> buf:string -> pos:int -> int -> unit
val unpack_unsigned_16_big_endian : buf:string -> pos:int -> int
val unpack_unsigned_16_little_endian : buf:string -> pos:int -> int
val pack_unsigned_16_big_endian : buf:string -> pos:int -> int -> unit
val pack_unsigned_16_little_endian : buf:string -> pos:int -> int -> unit
val unpack_signed_16_big_endian : buf:string -> pos:int -> int
val unpack_signed_16_little_endian : buf:string -> pos:int -> int
val pack_signed_16_big_endian : buf:string -> pos:int -> int -> unit
val pack_signed_16_little_endian : buf:string -> pos:int -> int -> unit
val unpack_unsigned_16 : byte_order:endian -> buf:string -> pos:int -> int
val pack_unsigned_16 : byte_order:endian -> buf:string -> pos:int -> int -> unit
val unpack_signed_32 : byte_order:endian -> buf:string -> pos:int -> int32
val unpack_signed_32_int : byte_order:endian -> buf:string -> pos:int -> int
val pack_signed_32 : byte_order:endian -> buf:string -> pos:int -> Int32.t -> unit
val pack_signed_32_int : byte_order:endian -> buf:string -> pos:int -> int -> unit
val unpack_unsigned_32_int_big_endian : buf:string -> pos:int -> int
val unpack_unsigned_32_int_little_endian : buf:string -> pos:int -> int
val pack_unsigned_32_int_big_endian : buf:string -> pos:int -> int -> unit
val pack_unsigned_32_int_little_endian : buf:string -> pos:int -> int -> unit
val unpack_signed_32_int_big_endian : buf:string -> pos:int -> int
val unpack_signed_32_int_little_endian : buf:string -> pos:int -> int
val pack_signed_32_int_big_endian : buf:string -> pos:int -> int -> unit
val pack_signed_32_int_little_endian : buf:string -> pos:int -> int -> unit
val unpack_unsigned_32_int : byte_order:endian -> buf:string -> pos:int -> int
val pack_unsigned_32_int : byte_order:endian -> buf:string -> pos:int -> int -> unit
val unpack_signed_64 : byte_order:endian -> buf:string -> pos:int -> int64
val unpack_signed_64_int : byte_order:endian -> buf:string -> pos:int -> int
val pack_signed_64 : byte_order:endian -> buf:string -> pos:int -> Int64.t -> unit
val pack_signed_64_int : byte_order:endian -> buf:string -> pos:int -> int -> unit
val unpack_signed_64_big_endian : buf:string -> pos:int -> int64
val unpack_signed_64_little_endian : buf:string -> pos:int -> int64
val pack_signed_64_big_endian : buf:string -> pos:int -> int64 -> unit
val pack_signed_64_little_endian : buf:string -> pos:int -> int64 -> unit
val unpack_float : byte_order:endian -> buf:string -> pos:int -> float
val pack_float : byte_order:endian -> buf:string -> pos:int -> float -> unit
val unpack_padded_fixed_string : ?padding:char -> buf:string -> pos:int -> len:int -> unit -> string
Decode the fixed length padded string having length len
from
buf
starting at pos
. Return a string containing only the non-padding
characters. The default padding is '\x00'.
val pack_padded_fixed_string : ?padding:char -> buf:string -> pos:int -> len:int -> string -> unit
Encode and pack the given string as a padded fixed length string
having length len
. Place it in buf
starting at position pos
. If
the length of the string is less then len
pad it with the padding
characters until its length is equal to len
. If the string is
longer than len
raise Invalid_argument
. The default padding is '\x00'.
val test : unit -> unit