Loading

->OPB64

conversion

Encode a String in order preserving base64. OPB64 is a Base64 like encoding which preserves the lexicographic order of the original byte arrays in the encoded ones. This is useful to compare encoded byte arrays without having to first decode them.

->OPB64 is available since version 1.0.6.

See also

Signatures

Examples

//sort an opb64 encoded list. [ 'orange' 'banana' 'lemon' 'avocado' 'apple' ] [ SWAP <% ->OPB64 %> FOREACH ] //opb64 encode DUP LSORT //uncomment me to sort the OPB64 list [ SWAP <% OPB64-> 'UTF-8' BYTES-> %> FOREACH ] //obp64 decode
//try to sort an b64 encoded list (it does not work) [ 'orange' 'banana' 'lemon' 'avocado' 'apple' ] [ SWAP <% ->B64 %> FOREACH ] //opb64 encode DUP LSORT //uncomment me to sort the OPB64 list [ SWAP <% B64-> 'UTF-8' BYTES-> %> FOREACH ] //obp64 decode
//Encoding a byte array 'ÇÉÈÄ€' DUP 'latin9' ->BYTES ->OPB64 DUP OPB64-> 'latin9' BYTES->