package orsetto
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=151ca6df499bd3de7aa89a4e1627411fbee24c4dea6e0e71ce21f06f181ee654
md5=00393728b481c2bf15919a8202732335
doc/orsetto.cf/Cf_endian_big/index.html
Module Cf_endian_big
Utility functions for big-endian byte order.
Overview
Primitive functions for ingesting and rendering integers and floating point numbers to and from subranges of strings and byte sequences using the "big-endian" explicit octet ordering discipline.
Module inclusion
include Cf_endian_core.Safe
A Latin-1 string describing the endian mode, e.g. "LE"
for little-endian or "BE"
for big-endian.
val lds8 : int Cf_decode.scheme
Use r#scan lds8
to read one octet with r
as a signed 8-bit integer in the range -128
to 127
.
val ldu8 : int Cf_decode.scheme
Use r#scan ldu8
to read one octet with r
as an unsigned 8-bit integer in the range 0
to 255
.
val lds16 : int Cf_decode.scheme
Use r#scan lds16
to read two octets with r
as a signed 16-bit integer in the range -32768
to 32767
.
val ldu16 : int Cf_decode.scheme
Use r#scan ldu16
to read two octets with r
as an unsigned 16-bit integer in the range 0
to 65535
.
val lds32 : int Cf_decode.scheme
Use r#scan lds32
to read four octets with r
as a signed 32-bit integer in the range -2147483648
to 2147483647
. Raises Cf_decode.Invalid
where Sys.int_length < 32
and the value cannot be represented by the OCaml int
type.
val ldu32 : int Cf_decode.scheme
Use r#scan ldu32
to read four octets with r
as an unsigned 32-bit integer in the range 0
to 4294967295
. Raises Cf_decode.Invalid
if the value cannot be represented by the OCaml int
type.
val lds64 : int Cf_decode.scheme
Use r#scan lds64
to read eight octets with r
as a signed 64-bit integer in the range -9223372036854775808
to 9223372036854775807
. Raises Cf_decode.Invalid
if the value cannot be represented by the OCaml int
type.
val ldu64 : int Cf_decode.scheme
Use r#scan ldu64
to read eight octets with r
as an unsigned 64-bit integer in the range 0
to 18446744073709551615
. Raises Cf_decode.Invalid
if the value cannot be represented by the OCaml int
type.
val ldi32 : int32 Cf_decode.scheme
Use r#scan ldi32
to read four octets with r
as a signed 32-bit integer in the range -2147483648
to 2147483647
.
val ldi64 : int64 Cf_decode.scheme
Use r#scan ldi32
to read eight octets with r
as a signed 64-bit integer in the range -9223372036854775808
to 9223372036854775807
.
val ldf16 : float Cf_decode.scheme
Use r#scan ldf16
to read two octets with r
as a binary16 format IEEE 754 floating point number.
val ldf32 : float Cf_decode.scheme
Use r#scan ldf32
to read four octets with r
as a binary32 format IEEE 754 floating point number.
val ldf64 : float Cf_decode.scheme
Use r#scan ldf64
to read eight octets with r
as a binary64 format IEEE 754 floating point number.
val sts8 : int Cf_encode.scheme
Use w#emit sts8
to write with w
a signed 8-bit integer as one octet. Raises Invalid_argument
if the value to emit is not in the range -128
to 127
.
val stu8 : int Cf_encode.scheme
Use w#emit stu8
to write with w
an unsigned 8-bit integer as one octet. Raises Invalid_argument
if the value to emit is not in the range 0
to 255
.
val sts16 : int Cf_encode.scheme
Use w#emit sts16
to write with w
a signed 16-bit integer as two octets. Raises Invalid_argument
if the value to emit is not in the range -32768
to 32767
.
val stu16 : int Cf_encode.scheme
Use w#emit stu16
to write with w
an unsigned 16-bit integer as two octets. Raises Invalid_argument
if the value to emit is not in the range 0
to 65535
.
val sts32 : int Cf_encode.scheme
Use w#emit sts32
to write with w
a signed 32-bit integer as four octets. Raises Invalid_argument
if the value to emit is not in the range -32768
to 32767
.
val stu32 : int Cf_encode.scheme
Use w#emit stu32
to write with w
an unsigned 32-bit integer as four octets. Raises Invalid_argument
if the value to emit is not in the range 0
to 65535
.
val sts64 : int Cf_encode.scheme
Use w#emit sts64
to write with w
a signed 64-bit integer as eight octets. Raises Invalid_argument
if the value to emit is not in the range -9223372036854775808
to 9223372036854775807
.
val stu64 : int Cf_encode.scheme
Use w#emit stu64
to write with w
an unsigned 64-bit integer as eight octets. Raises Invalid_argument
if the value to emit is not in the range 0
to 18446744073709551615
.
val sti32 : int32 Cf_encode.scheme
Use w#emit sti32
to write with w
a signed 32-bit integer as four octets.
val sti64 : int64 Cf_encode.scheme
Use w#emit sti64
to write with w
a signed 64-bit integer as eight octets.
val stf16 : float Cf_encode.scheme
Use w#emit stf16
to write with w
a floating point number as the four octets comprising a binary16 format IEEE 754 number. Raises Imprecise
if the conversion truncates the fractional part or overflows the exponent part. Conversion of NaN always results in a signaling NaN.
val stf32 : float Cf_encode.scheme
Use w#emit stf32
to write with w
a floating point number as the four octets comprising a binary32 format IEEE 754 number. Raises Imprecise
if the conversion truncates the fractional part or overflows the exponent part. Conversion of NaN always results in a signaling NaN.
val stf64 : float Cf_encode.scheme
Use w#emit stf64
to write with w
a floating point number as the eight octets comprising a binary64 format IEEE 754 number.
module Unsafe : sig ... end
The functions in this module offer fast unsafe operations that provide correct behavior only when the parameters are valid, i.e. when the position and length are valid for the string or byte sequence, and when integer and float quantities can converted between representations without error.