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