Handbook
Glossary
le> ( seq -- x )
Working with binary data
Prev:
be> ( seq -- x )
Next:
>be ( x n -- byte-array )
Vocabulary
endian
Inputs
seq
a
sequence
of bytes
Outputs
x
a non-negative integer
Word description
Converts a sequence of bytes in little endian order into an unsigned integer.
Definition
USING:
alien.c-types
combinators
endian.private
kernel
sequences
;
IN:
endian
:
le>
( seq -- x )
dup
length
{
{
1
[
uint8_t
1
n-le>
]
}
{
2
[
uint16_t
2
n-le>
]
}
{
4
[
uint32_t
4
n-le>
]
}
{
8
[
uint64_t
8
n-le>
]
}
[
drop
slow-le>
]
}
case
;