Namespaces

Functions

  • uint8_t U8FromNativeEndian (std::span<const uint8_t, 1U> bytes)

    Returns a uint8_t with the value in `bytes` interpreted as the native endian

    encoding of the integer for the machine.

    This is suitable for decoding integers that were always kept in native

    encoding, such as when stored in shared-memory (or through IPC) as a byte

    buffer. Prefer an explicit little endian when storing and reading data from

    storage, and explicit big endian for network order.

    Note that since a single byte can have only one ordering, this just copies

    the byte out of the span. This provides a consistent function for the

    operation nonetheless.

    Defined at line 40 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • uint16_t U16FromNativeEndian (std::span<const uint8_t, 2U> bytes)

    Returns a uint16_t with the value in `bytes` interpreted as the native endian

    encoding of the integer for the machine.

    This is suitable for decoding integers that were always kept in native

    encoding, such as when stored in shared-memory (or through IPC) as a byte

    buffer. Prefer an explicit little endian when storing and reading data from

    storage, and explicit big endian for network order.

    Defined at line 51 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • uint32_t U32FromNativeEndian (std::span<const uint8_t, 4U> bytes)

    Returns a uint32_t with the value in `bytes` interpreted as the native endian

    encoding of the integer for the machine.

    This is suitable for decoding integers that were always kept in native

    encoding, such as when stored in shared-memory (or through IPC) as a byte

    buffer. Prefer an explicit little endian when storing and reading data from

    storage, and explicit big endian for network order.

    Defined at line 62 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • uint64_t U64FromNativeEndian (std::span<const uint8_t, 8U> bytes)

    Returns a uint64_t with the value in `bytes` interpreted as the native endian

    encoding of the integer for the machine.

    This is suitable for decoding integers that were always kept in native

    encoding, such as when stored in shared-memory (or through IPC) as a byte

    buffer. Prefer an explicit little endian when storing and reading data from

    storage, and explicit big endian for network order.

    Defined at line 73 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • int8_t I8FromNativeEndian (std::span<const uint8_t, 1U> bytes)

    Returns a int8_t with the value in `bytes` interpreted as the native endian

    encoding of the integer for the machine.

    This is suitable for decoding integers that were always kept in native

    encoding, such as when stored in shared-memory (or through IPC) as a byte

    buffer. Prefer an explicit little endian when storing and reading data from

    storage, and explicit big endian for network order.

    Note that since a single byte can have only one ordering, this just copies

    the byte out of the span. This provides a consistent function for the

    operation nonetheless.

    Defined at line 88 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • int16_t I16FromNativeEndian (std::span<const uint8_t, 2U> bytes)

    Returns a int16_t with the value in `bytes` interpreted as the native endian

    encoding of the integer for the machine.

    This is suitable for decoding integers that were always kept in native

    encoding, such as when stored in shared-memory (or through IPC) as a byte

    buffer. Prefer an explicit little endian when storing and reading data from

    storage, and explicit big endian for network order.

    Defined at line 98 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • int32_t I32FromNativeEndian (std::span<const uint8_t, 4U> bytes)

    Returns a int32_t with the value in `bytes` interpreted as the native endian

    encoding of the integer for the machine.

    This is suitable for decoding integers that were always kept in native

    encoding, such as when stored in shared-memory (or through IPC) as a byte

    buffer. Prefer an explicit little endian when storing and reading data from

    storage, and explicit big endian for network order.

    Defined at line 109 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • int64_t I64FromNativeEndian (std::span<const uint8_t, 8U> bytes)

    Returns a int64_t with the value in `bytes` interpreted as the native endian

    encoding of the integer for the machine.

    This is suitable for decoding integers that were always kept in native

    encoding, such as when stored in shared-memory (or through IPC) as a byte

    buffer. Prefer an explicit little endian when storing and reading data from

    storage, and explicit big endian for network order.

    Defined at line 120 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • float FloatFromNativeEndian (std::span<const uint8_t, 4U> bytes)

    Returns a float with the value in `bytes` interpreted as the native endian

    encoding of the number for the machine.

    This is suitable for decoding numbers that were always kept in native

    encoding, such as when stored in shared-memory (or through IPC) as a byte

    buffer. Prefer an explicit little endian when storing and reading data from

    storage, and explicit big endian for network order.

    Defined at line 132 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • double DoubleFromNativeEndian (std::span<const uint8_t, 8U> bytes)

    Returns a double with the value in `bytes` interpreted as the native endian

    encoding of the number for the machine.

    This is suitable for decoding numbers that were always kept in native

    encoding, such as when stored in shared-memory (or through IPC) as a byte

    buffer. Prefer an explicit little endian when storing and reading data from

    storage, and explicit big endian for network order.

    Defined at line 143 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • uint8_t U8FromLittleEndian (std::span<const uint8_t, 1U> bytes)

    Returns a uint8_t with the value in `bytes` interpreted as a little-endian

    encoding of the integer.

    This is suitable for decoding integers encoded explicitly in little endian,

    which is a good practice with storing and reading data from storage. Use

    the native-endian versions when working with values that were always in

    memory, such as when stored in shared-memory (or through IPC) as a byte

    buffer.

    Note that since a single byte can have only one ordering, this just copies

    the byte out of the span. This provides a consistent function for the

    operation nonetheless.

    Defined at line 160 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • uint16_t U16FromLittleEndian (std::span<const uint8_t, 2U> bytes)

    Returns a uint16_t with the value in `bytes` interpreted as a little-endian

    encoding of the integer.

    This is suitable for decoding integers encoded explicitly in little endian,

    which is a good practice with storing and reading data from storage. Use

    the native-endian versions when working with values that were always in

    memory, such as when stored in shared-memory (or through IPC) as a byte

    buffer.

    Defined at line 172 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • uint32_t U32FromLittleEndian (std::span<const uint8_t, 4U> bytes)

    Returns a uint32_t with the value in `bytes` interpreted as a little-endian

    encoding of the integer.

    This is suitable for decoding integers encoded explicitly in little endian,

    which is a good practice with storing and reading data from storage. Use

    the native-endian versions when working with values that were always in

    memory, such as when stored in shared-memory (or through IPC) as a byte

    buffer.

    Defined at line 184 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • uint64_t U64FromLittleEndian (std::span<const uint8_t, 8U> bytes)

    Returns a uint64_t with the value in `bytes` interpreted as a little-endian

    encoding of the integer.

    This is suitable for decoding integers encoded explicitly in little endian,

    which is a good practice with storing and reading data from storage. Use

    the native-endian versions when working with values that were always in

    memory, such as when stored in shared-memory (or through IPC) as a byte

    buffer.

    Defined at line 196 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • int8_t I8FromLittleEndian (std::span<const uint8_t, 1U> bytes)

    Returns a int8_t with the value in `bytes` interpreted as a little-endian

    encoding of the integer.

    This is suitable for decoding integers encoded explicitly in little endian,

    which is a good practice with storing and reading data from storage. Use

    the native-endian versions when working with values that were always in

    memory, such as when stored in shared-memory (or through IPC) as a byte

    buffer.

    Note that since a single byte can have only one ordering, this just copies

    the byte out of the span. This provides a consistent function for the

    operation nonetheless.

    Defined at line 212 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • int16_t I16FromLittleEndian (std::span<const uint8_t, 2U> bytes)

    Returns a int16_t with the value in `bytes` interpreted as a little-endian

    encoding of the integer.

    This is suitable for decoding integers encoded explicitly in little endian,

    which is a good practice with storing and reading data from storage. Use

    the native-endian versions when working with values that were always in

    memory, such as when stored in shared-memory (or through IPC) as a byte

    buffer.

    Defined at line 223 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • int32_t I32FromLittleEndian (std::span<const uint8_t, 4U> bytes)

    Returns a int32_t with the value in `bytes` interpreted as a little-endian

    encoding of the integer.

    This is suitable for decoding integers encoded explicitly in little endian,

    which is a good practice with storing and reading data from storage. Use

    the native-endian versions when working with values that were always in

    memory, such as when stored in shared-memory (or through IPC) as a byte

    buffer.

    Defined at line 235 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • int64_t I64FromLittleEndian (std::span<const uint8_t, 8U> bytes)

    Returns a int64_t with the value in `bytes` interpreted as a little-endian

    encoding of the integer.

    This is suitable for decoding integers encoded explicitly in little endian,

    which is a good practice with storing and reading data from storage. Use

    the native-endian versions when working with values that were always in

    memory, such as when stored in shared-memory (or through IPC) as a byte

    buffer.

    Defined at line 247 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • float FloatFromLittleEndian (std::span<const uint8_t, 4U> bytes)

    Returns a float with the value in `bytes` interpreted as a little-endian

    encoding of the integer.

    This is suitable for decoding numbers encoded explicitly in little endian,

    which is a good practice with storing and reading data from storage. Use

    the native-endian versions when working with values that were always in

    memory, such as when stored in shared-memory (or through IPC) as a byte

    buffer.

    Defined at line 259 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • double DoubleFromLittleEndian (std::span<const uint8_t, 8U> bytes)

    Returns a double with the value in `bytes` interpreted as a little-endian

    encoding of the integer.

    This is suitable for decoding numbers encoded explicitly in little endian,

    which is a good practice with storing and reading data from storage. Use

    the native-endian versions when working with values that were always in

    memory, such as when stored in shared-memory (or through IPC) as a byte

    buffer.

    Defined at line 271 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • uint8_t U8FromBigEndian (std::span<const uint8_t, 1U> bytes)

    Returns a uint8_t with the value in `bytes` interpreted as a big-endian

    encoding of the integer.

    This is suitable for decoding integers encoded explicitly in big endian, such

    as for network order. Use the native-endian versions when working with values

    that were always in memory, such as when stored in shared-memory (or through

    IPC) as a byte buffer.

    Note that since a single byte can have only one ordering, this just copies

    the byte out of the span. This provides a consistent function for the

    operation nonetheless.

    Defined at line 287 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • uint16_t U16FromBigEndian (std::span<const uint8_t, 2U> bytes)

    Returns a uint16_t with the value in `bytes` interpreted as a big-endian

    encoding of the integer.

    This is suitable for decoding integers encoded explicitly in big endian, such

    as for network order. Use the native-endian versions when working with values

    that were always in memory, such as when stored in shared-memory (or through

    IPC) as a byte buffer.

    Defined at line 297 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • uint32_t U32FromBigEndian (std::span<const uint8_t, 4U> bytes)

    Returns a uint32_t with the value in `bytes` interpreted as a big-endian

    encoding of the integer.

    This is suitable for decoding integers encoded explicitly in big endian, such

    as for network order. Use the native-endian versions when working with values

    that were always in memory, such as when stored in shared-memory (or through

    IPC) as a byte buffer.

    Defined at line 307 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • uint64_t U64FromBigEndian (std::span<const uint8_t, 8U> bytes)

    Returns a uint64_t with the value in `bytes` interpreted as a big-endian

    encoding of the integer.

    This is suitable for decoding integers encoded explicitly in big endian, such

    as for network order. Use the native-endian versions when working with values

    that were always in memory, such as when stored in shared-memory (or through

    IPC) as a byte buffer.

    Defined at line 317 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • int8_t I8FromBigEndian (std::span<const uint8_t, 1U> bytes)

    Returns a int8_t with the value in `bytes` interpreted as a big-endian

    encoding of the integer.

    This is suitable for decoding integers encoded explicitly in big endian, such

    as for network order. Use the native-endian versions when working with values

    that were always in memory, such as when stored in shared-memory (or through

    IPC) as a byte buffer.

    Note that since a single byte can have only one ordering, this just copies

    the byte out of the span. This provides a consistent function for the

    operation nonetheless.

    Defined at line 331 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • int16_t I16FromBigEndian (std::span<const uint8_t, 2U> bytes)

    Returns a int16_t with the value in `bytes` interpreted as a big-endian

    encoding of the integer.

    This is suitable for decoding integers encoded explicitly in big endian, such

    as for network order. Use the native-endian versions when working with values

    that were always in memory, such as when stored in shared-memory (or through

    IPC) as a byte buffer.

    Defined at line 341 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • int32_t I32FromBigEndian (std::span<const uint8_t, 4U> bytes)

    Returns a int32_t with the value in `bytes` interpreted as a big-endian

    encoding of the integer.

    This is suitable for decoding integers encoded explicitly in big endian, such

    as for network order. Use the native-endian versions when working with values

    that were always in memory, such as when stored in shared-memory (or through

    IPC) as a byte buffer.

    Defined at line 351 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • template <typename Dst = int, typename Src>
    Dst ClampFloor (Src value)

    Rounds towards negative infinity (i.e., down).

    Defined at line 359 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions.h

  • int64_t I64FromBigEndian (std::span<const uint8_t, 8U> bytes)

    Returns a int64_t with the value in `bytes` interpreted as a big-endian

    encoding of the integer.

    This is suitable for decoding integers encoded explicitly in big endian, such

    as for network order. Use the native-endian versions when working with values

    that were always in memory, such as when stored in shared-memory (or through

    IPC) as a byte buffer.

    Defined at line 361 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • template <typename Dst = int, typename Src>
    Dst ClampCeil (Src value)

    Rounds towards positive infinity (i.e., up).

    Defined at line 366 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions.h

  • float FloatFromBigEndian (std::span<const uint8_t, 4U> bytes)

    Returns a float with the value in `bytes` interpreted as a big-endian

    encoding of the integer.

    This is suitable for decoding numbers encoded explicitly in big endian, such

    as for network order. Use the native-endian versions when working with values

    that were always in memory, such as when stored in shared-memory (or through

    IPC) as a byte buffer.

    Defined at line 371 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • double DoubleFromBigEndian (std::span<const uint8_t, 8U> bytes)

    Returns a double with the value in `bytes` interpreted as a big-endian

    encoding of the integer.

    This is suitable for decoding numbers encoded explicitly in big endian, such

    as for network order. Use the native-endian versions when working with values

    that were always in memory, such as when stored in shared-memory (or through

    IPC) as a byte buffer.

    Defined at line 381 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • template <typename Dst = int, typename Src>
    Dst ClampRound (Src value)

    Rounds towards nearest integer, with ties away from zero.

    This means that 0.5 will be rounded to 1 and 1.5 will be rounded to 2.

    Similarly, -0.5 will be rounded to -1 and -1.5 will be rounded to -2.

    This is normally not what you want accuracy-wise (it introduces a small bias

    away from zero), and it is not the fastest option, but it is frequently what

    existing code expects. Compare with saturated_cast

    <Dst

    >(std::nearbyint(x))

    or std::lrint(x), which would round 0.5 and -0.5 to 0 but 1.5 to 2 and

    -1.5 to -2.

    Defined at line 381 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions.h

  • std::array<uint8_t, 1U> U8ToNativeEndian (uint8_t val)

    Returns a byte array holding the value of a uint8_t encoded as the native

    endian encoding of the integer for the machine.

    This is suitable for encoding integers that will always be kept in native

    encoding, such as for storing in shared-memory (or sending through IPC) as a

    byte buffer. Prefer an explicit little endian when storing data into external

    storage, and explicit big endian for network order.

    Defined at line 393 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 2U> U16ToNativeEndian (uint16_t val)

    Returns a byte array holding the value of a uint16_t encoded as the native

    endian encoding of the integer for the machine.

    This is suitable for encoding integers that will always be kept in native

    encoding, such as for storing in shared-memory (or sending through IPC) as a

    byte buffer. Prefer an explicit little endian when storing data into external

    storage, and explicit big endian for network order.

    Defined at line 403 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 4U> U32ToNativeEndian (uint32_t val)

    Returns a byte array holding the value of a uint32_t encoded as the native

    endian encoding of the integer for the machine.

    This is suitable for encoding integers that will always be kept in native

    encoding, such as for storing in shared-memory (or sending through IPC) as a

    byte buffer. Prefer an explicit little endian when storing data into external

    storage, and explicit big endian for network order.

    Defined at line 413 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 8U> U64ToNativeEndian (uint64_t val)

    Returns a byte array holding the value of a uint64_t encoded as the native

    endian encoding of the integer for the machine.

    This is suitable for encoding integers that will always be kept in native

    encoding, such as for storing in shared-memory (or sending through IPC) as a

    byte buffer. Prefer an explicit little endian when storing data into external

    storage, and explicit big endian for network order.

    Defined at line 423 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 1U> I8ToNativeEndian (int8_t val)

    Returns a byte array holding the value of a int8_t encoded as the native

    endian encoding of the integer for the machine.

    This is suitable for encoding integers that will always be kept in native

    encoding, such as for storing in shared-memory (or sending through IPC) as a

    byte buffer. Prefer an explicit little endian when storing data into external

    storage, and explicit big endian for network order.

    Defined at line 433 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 2U> I16ToNativeEndian (int16_t val)

    Returns a byte array holding the value of a int16_t encoded as the native

    endian encoding of the integer for the machine.

    This is suitable for encoding integers that will always be kept in native

    encoding, such as for storing in shared-memory (or sending through IPC) as a

    byte buffer. Prefer an explicit little endian when storing data into external

    storage, and explicit big endian for network order.

    Defined at line 443 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 4U> I32ToNativeEndian (int32_t val)

    Returns a byte array holding the value of a int32_t encoded as the native

    endian encoding of the integer for the machine.

    This is suitable for encoding integers that will always be kept in native

    encoding, such as for storing in shared-memory (or sending through IPC) as a

    byte buffer. Prefer an explicit little endian when storing data into external

    storage, and explicit big endian for network order.

    Defined at line 453 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 8U> I64ToNativeEndian (int64_t val)

    Returns a byte array holding the value of a int64_t encoded as the native

    endian encoding of the integer for the machine.

    This is suitable for encoding integers that will always be kept in native

    encoding, such as for storing in shared-memory (or sending through IPC) as a

    byte buffer. Prefer an explicit little endian when storing data into external

    storage, and explicit big endian for network order.

    Defined at line 463 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 4U> FloatToNativeEndian (float val)

    Returns a byte array holding the value of a float encoded as the native

    endian encoding of the number for the machine.

    This is suitable for encoding numbers that will always be kept in native

    encoding, such as for storing in shared-memory (or sending through IPC) as a

    byte buffer. Prefer an explicit little endian when storing data into external

    storage, and explicit big endian for network order.

    Defined at line 473 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 8U> DoubleToNativeEndian (double val)

    Returns a byte array holding the value of a double encoded as the native

    endian encoding of the number for the machine.

    This is suitable for encoding numbers that will always be kept in native

    encoding, such as for storing in shared-memory (or sending through IPC) as a

    byte buffer. Prefer an explicit little endian when storing data into external

    storage, and explicit big endian for network order.

    Defined at line 483 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 1U> U8ToLittleEndian (uint8_t val)

    Returns a byte array holding the value of a uint8_t encoded as the

    little-endian encoding of the integer.

    This is suitable for encoding integers explicitly in little endian, which is

    a good practice with storing and reading data from storage. Use the

    native-endian versions when working with values that will always be in

    memory, such as when stored in shared-memory (or passed through IPC) as a

    byte buffer.

    Defined at line 495 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 2U> U16ToLittleEndian (uint16_t val)

    Returns a byte array holding the value of a uint16_t encoded as the

    little-endian encoding of the integer.

    This is suitable for encoding integers explicitly in little endian, which is

    a good practice with storing and reading data from storage. Use the

    native-endian versions when working with values that will always be in

    memory, such as when stored in shared-memory (or passed through IPC) as a

    byte buffer.

    Defined at line 506 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 4U> U32ToLittleEndian (uint32_t val)

    Returns a byte array holding the value of a uint32_t encoded as the

    little-endian encoding of the integer.

    This is suitable for encoding integers explicitly in little endian, which is

    a good practice with storing and reading data from storage. Use the

    native-endian versions when working with values that will always be in

    memory, such as when stored in shared-memory (or passed through IPC) as a

    byte buffer.

    Defined at line 517 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 8U> U64ToLittleEndian (uint64_t val)

    Returns a byte array holding the value of a uint64_t encoded as the

    little-endian encoding of the integer.

    This is suitable for encoding integers explicitly in little endian, which is

    a good practice with storing and reading data from storage. Use the

    native-endian versions when working with values that will always be in

    memory, such as when stored in shared-memory (or passed through IPC) as a

    byte buffer.

    Defined at line 528 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 1U> I8ToLittleEndian (int8_t val)

    Returns a byte array holding the value of a int8_t encoded as the

    little-endian encoding of the integer.

    This is suitable for encoding integers explicitly in little endian, which is

    a good practice with storing and reading data from storage. Use the

    native-endian versions when working with values that will always be in

    memory, such as when stored in shared-memory (or passed through IPC) as a

    byte buffer.

    Defined at line 539 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 2U> I16ToLittleEndian (int16_t val)

    Returns a byte array holding the value of a int16_t encoded as the

    little-endian encoding of the integer.

    This is suitable for encoding integers explicitly in little endian, which is

    a good practice with storing and reading data from storage. Use the

    native-endian versions when working with values that will always be in

    memory, such as when stored in shared-memory (or passed through IPC) as a

    byte buffer.

    Defined at line 550 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 4U> I32ToLittleEndian (int32_t val)

    Returns a byte array holding the value of a int32_t encoded as the

    little-endian encoding of the integer.

    This is suitable for encoding integers explicitly in little endian, which is

    a good practice with storing and reading data from storage. Use the

    native-endian versions when working with values that will always be in

    memory, such as when stored in shared-memory (or passed through IPC) as a

    byte buffer.

    Defined at line 561 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 8U> I64ToLittleEndian (int64_t val)

    Returns a byte array holding the value of a int64_t encoded as the

    little-endian encoding of the integer.

    This is suitable for encoding integers explicitly in little endian, which is

    a good practice with storing and reading data from storage. Use the

    native-endian versions when working with values that will always be in

    memory, such as when stored in shared-memory (or passed through IPC) as a

    byte buffer.

    Defined at line 572 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 4U> FloatToLittleEndian (float val)

    Returns a byte array holding the value of a float encoded as the

    little-endian encoding of the number.

    This is suitable for encoding numbers explicitly in little endian, which is

    a good practice with storing and reading data from storage. Use the

    native-endian versions when working with values that will always be in

    memory, such as when stored in shared-memory (or passed through IPC) as a

    byte buffer.

    Defined at line 583 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 8U> DoubleToLittleEndian (double val)

    Returns a byte array holding the value of a double encoded as the

    little-endian encoding of the number.

    This is suitable for encoding numbers explicitly in little endian, which is

    a good practice with storing and reading data from storage. Use the

    native-endian versions when working with values that will always be in

    memory, such as when stored in shared-memory (or passed through IPC) as a

    byte buffer.

    Defined at line 594 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 1U> U8ToBigEndian (uint8_t val)

    Returns a byte array holding the value of a uint8_t encoded as the big-endian

    encoding of the integer.

    This is suitable for encoding integers explicitly in big endian, such as for

    network order. Use the native-endian versions when working with values that

    are always in memory, such as when stored in shared-memory (or passed through

    IPC) as a byte buffer. Use the little-endian encoding for storing and reading

    from storage.

    Defined at line 606 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 2U> U16ToBigEndian (uint16_t val)

    Returns a byte array holding the value of a uint16_t encoded as the

    big-endian encoding of the integer.

    This is suitable for encoding integers explicitly in big endian, such as for

    network order. Use the native-endian versions when working with values that

    are always in memory, such as when stored in shared-memory (or passed through

    IPC) as a byte buffer. Use the little-endian encoding for storing and reading

    from storage.

    Defined at line 617 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 4U> U32ToBigEndian (uint32_t val)

    Returns a byte array holding the value of a uint32_t encoded as the

    big-endian encoding of the integer.

    This is suitable for encoding integers explicitly in big endian, such as for

    network order. Use the native-endian versions when working with values that

    are always in memory, such as when stored in shared-memory (or passed through

    IPC) as a byte buffer. Use the little-endian encoding for storing and reading

    from storage.

    Defined at line 628 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 8U> U64ToBigEndian (uint64_t val)

    Returns a byte array holding the value of a uint64_t encoded as the

    big-endian encoding of the integer.

    This is suitable for encoding integers explicitly in big endian, such as for

    network order. Use the native-endian versions when working with values that

    are always in memory, such as when stored in shared-memory (or passed through

    IPC) as a byte buffer. Use the little-endian encoding for storing and reading

    from storage.

    Defined at line 639 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 1U> I8ToBigEndian (int8_t val)

    Returns a byte array holding the value of a int8_t encoded as the big-endian

    encoding of the integer.

    This is suitable for encoding integers explicitly in big endian, such as for

    network order. Use the native-endian versions when working with values that

    are always in memory, such as when stored in shared-memory (or passed through

    IPC) as a byte buffer. Use the little-endian encoding for storing and reading

    from storage.

    Defined at line 650 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 2U> I16ToBigEndian (int16_t val)

    Returns a byte array holding the value of a int16_t encoded as the

    big-endian encoding of the integer.

    This is suitable for encoding integers explicitly in big endian, such as for

    network order. Use the native-endian versions when working with values that

    are always in memory, such as when stored in shared-memory (or passed through

    IPC) as a byte buffer. Use the little-endian encoding for storing and reading

    from storage.

    Defined at line 661 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 4U> I32ToBigEndian (int32_t val)

    Returns a byte array holding the value of a int32_t encoded as the

    big-endian encoding of the integer.

    This is suitable for encoding integers explicitly in big endian, such as for

    network order. Use the native-endian versions when working with values that

    are always in memory, such as when stored in shared-memory (or passed through

    IPC) as a byte buffer. Use the little-endian encoding for storing and reading

    from storage.

    Defined at line 672 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 8U> I64ToBigEndian (int64_t val)

    Returns a byte array holding the value of a int64_t encoded as the

    big-endian encoding of the integer.

    This is suitable for encoding integers explicitly in big endian, such as for

    network order. Use the native-endian versions when working with values that

    are always in memory, such as when stored in shared-memory (or passed through

    IPC) as a byte buffer. Use the little-endian encoding for storing and reading

    from storage.

    Defined at line 683 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 4U> FloatToBigEndian (float val)

    Returns a byte array holding the value of a float encoded as the big-endian

    encoding of the number.

    This is suitable for encoding numbers explicitly in big endian, such as for

    network order. Use the native-endian versions when working with values that

    are always in memory, such as when stored in shared-memory (or passed through

    IPC) as a byte buffer. Use the little-endian encoding for storing and reading

    from storage.

    Defined at line 694 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

  • std::array<uint8_t, 8U> DoubleToBigEndian (double val)

    Returns a byte array holding the value of a double encoded as the big-endian

    encoding of the number.

    This is suitable for encoding numbers explicitly in big endian, such as for

    network order. Use the native-endian versions when working with values that

    are always in memory, such as when stored in shared-memory (or passed through

    IPC) as a byte buffer. Use the little-endian encoding for storing and reading

    from storage.

    Defined at line 706 of file ../../zircon/third_party/ulib/safemath/include/safemath/byte_conversions.h

Concepts

template <typename T> IntegralConstantLike std::is_integral_v<decltype(T::value)> && !std::is_same_v<_Bool, std::remove_const_t<decltype(T::value)> > && std::convertible_to<T, decltype(T::value)> && std::equality_comparable_with<T, decltype(T::value)> && std::bool_constant<T() == T::value>::value && std::bool_constant<static_cast<decltype(T::value)>(T()) == T::value>::value

Exposition-only concept from [span.syn]

Defined at line 14 of file ../../zircon/third_party/ulib/safemath/include/safemath/integral_constant_like.h