Handbook
Glossary
pack-bits ( seq -- seq' )
Vocabulary
ulid
.
private
Inputs
seq
an
object
Outputs
seq'
an
object
Definition
USING:
kernel
make
math
math.bitwise
sequences
;
IN:
ulid.private
:
pack-bits
( seq -- seq' )
5
swap
[
first
]
[
rest
]
bi
[
[
pick
5
>=
[
swap
5
shift
bitor
swap
5
-
[
,
0 8
]
when-zero
swap
]
[
3dup
rot
[
shift
]
[
5
-
shift
]
bi-curry
bi*
bitor
,
nip
5
rot
-
[
bits
8
]
keep
-
swap
]
if
]
each
2drop
]
B{
}
make
;