base85: change alphabet to byte-array.
parent
83d6c5b382
commit
103b15df97
|
@ -1,6 +1,6 @@
|
||||||
! Copyright (C) 2013 John Benediktsson.
|
! Copyright (C) 2013 John Benediktsson.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: base64.private combinators io io.binary
|
USING: base64.private byte-arrays combinators io io.binary
|
||||||
io.encodings.binary io.streams.byte-array kernel literals math
|
io.encodings.binary io.streams.byte-array kernel literals math
|
||||||
namespaces sequences ;
|
namespaces sequences ;
|
||||||
IN: base85
|
IN: base85
|
||||||
|
@ -10,9 +10,12 @@ ERROR: malformed-base85 ;
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
<<
|
<<
|
||||||
CONSTANT: alphabet
|
CONSTANT: alphabet $[
|
||||||
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~"
|
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~"
|
||||||
|
>byte-array
|
||||||
|
]
|
||||||
>>
|
>>
|
||||||
|
|
||||||
: ch>base85 ( ch -- ch )
|
: ch>base85 ( ch -- ch )
|
||||||
alphabet nth ; inline
|
alphabet nth ; inline
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue