Home

le64tohbe64toh

le64tohbe64toh is not a standard programming term or a single library function. Rather, it appears to be a concatenation of two endian-conversion macros used in C and C-like languages: le64toh and be64toh. These macros convert 64-bit integers from a specified byte order (little-endian or big-endian) to the host machine’s native byte order.

Endianness refers to the ordering of bytes within multi-byte values. Little-endian stores the least significant byte

le64toh converts a 64-bit value encoded in little-endian to the host’s endianness. be64toh does the same for

Availability and usage vary by platform. These macros are typically defined in endian-related headers such as

Notes: le64tohbe64toh is not a single standard API; treat it as a textual reference to the pair

See also: Endianness, Endian macros, 64-bit integers, htobe64, htole64.

first,
while
big-endian
stores
the
most
significant
byte
first.
The
host’s
endianness
determines
how
such
values
should
be
interpreted
after
being
read
from
external
data
sources
or
files.
a
value
encoded
in
big-endian.
On
a
little-endian
host,
le64toh
and
be64toh
may
be
no-ops
or
perform
minimal
checks;
on
a
big-endian
host,
they
swap
bytes
as
needed
to
produce
a
correct
host-order
value.
Their
counterparts
for
host-to-endian
conversions
are
htobe64,
htole64,
etc.
<endian.h>
or
<sys/endian.h>
on
Unix-like
systems.
Some
environments
provide
equivalent
functionality
via
compiler
intrinsics
or
different
header
names.
When
working
with
mixed-endian
binary
formats,
developers
apply
le64toh
to
little-endian
data
and
be64toh
to
big-endian
data
to
obtain
values
in
host
order.
of
macros.
Ensure
you
use
the
appropriate
macro
for
each
value
and
verify
header
availability
on
your
target
platform.