hqx-encode ( bytes -- chars )


Vocabulary
binhex.private

Inputs
bytesan object


Outputs
charsan object


Definition


: hqx-encode ( bytes -- chars )
[
[ 0 0 ] dip [
swap {
{ 0 [ nip ~quotation~ ~quotation~ bi 2 ] }
{
2
[
~quotation~ dip
~quotation~ ~quotation~ bi 4
]
}
{
4
[
~quotation~ dip
~quotation~ ~quotation~ bi 6
]
}
{
6
[
~quotation~ dip
~quotation~ ~quotation~ bi 2
]
}
} case
] each 6 swap - shift ch>hqx ,
] B{ } make ;