]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/base32/base32.factor
base16/32/64/85/91: declare base>ch as fixnum.
[factor.git] / extra / base32 / base32.factor
index b0681488de31196765e17bbc53097f6a843dea65..90c362f48f4831428ac9cb67e4f0f82d398d69c4 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2019 John Benediktsson
 ! See http://factorcode.org/license.txt for BSD license
 USING: base64.private byte-arrays combinators fry io io.binary
-io.encodings.binary io.streams.byte-array kernel literals math
-namespaces sequences ;
+io.encodings.binary io.streams.byte-array kernel kernel.private
+literals math namespaces sequences ;
 IN: base32
 
 ERROR: malformed-base32 ;
@@ -22,7 +22,7 @@ CONSTANT: alphabet $[ "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" >byte-array ]
 
 : base32>ch ( ch -- ch )
     $[ alphabet alphabet-inverse 0 CHAR: = pick set-nth ] nth
-    [ malformed-base32 ] unless* ; inline
+    [ malformed-base32 ] unless* { fixnum } declare ; inline
 
 : encode5 ( seq -- byte-array )
     be> { -35 -30 -25 -20 -15 -10 -5 0 } '[