base85: fix a bug with accidental extra characters in alphabet.

freebsd-work
John Benediktsson 2019-01-24 19:21:00 -08:00
parent 0ae9b17734
commit 1ff2722b15
2 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
USING: base85 kernel strings tools.test ;
{ t } [ "Hello, world" dup >base85 base85> >string = ] unit-test
{ t } [ "ready" dup >base85 base85> >string = ] unit-test
{ "NM!&3" } [ "He" >base85 >string ] unit-test
{ t } [ "He" dup >base85 base85> >string = ] unit-test

View File

@ -11,7 +11,7 @@ ERROR: malformed-base85 ;
<<
CONSTANT: alphabet
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~\";"
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~"
>>
: ch>base85 ( ch -- ch )
alphabet nth ; inline