]> gitweb.factorcode.org Git - factor.git/commitdiff
hashcash: quick fix for string argument to checksum-bytes.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 30 Jun 2016 21:50:47 +0000 (14:50 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 30 Jun 2016 21:50:47 +0000 (14:50 -0700)
extra/hashcash/hashcash.factor

index 008cd0ec87302ea57418d7ffd4196a20cfaaf480..95a8b43d47b17c51624e938d65873dce84df58ba 100644 (file)
@@ -1,8 +1,9 @@
 ! Copyright (C) 2009 Diego Martinelli.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors byte-arrays calendar calendar.format checksums
-checksums.openssl classes.tuple fry kernel make math math.functions
-math.parser math.ranges present random sequences splitting strings ;
+USING: accessors calendar calendar.format checksums
+checksums.openssl classes.tuple fry io.encodings.ascii
+io.encodings.string kernel math math.functions math.parser
+math.ranges present random sequences splitting ;
 IN: hashcash
 
 ! Hashcash implementation
@@ -49,7 +50,7 @@ M: hashcash string>>
 <PRIVATE
 
 : sha1-checksum ( str -- bytes )
-    openssl-sha1 checksum-bytes ; inline
+    ascii encode openssl-sha1 checksum-bytes ; inline
 
 : set-suffix ( tuple guess -- tuple )
     >hex >>suffix ;