]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/hashcash/hashcash.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / extra / hashcash / hashcash.factor
index 3e75aad94caaee2a80f78f555cb8ba2fc2fde9dd..2f94f3f2d695924bb3fb87e98546f0bdf6bbcadc 100755 (executable)
@@ -1,9 +1,8 @@
 ! 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 syntax ;
+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 ;
 IN: hashcash
 
 ! Hashcash implementation
@@ -70,14 +69,14 @@ M: hashcash string>>
 
 : (mint) ( tuple counter -- tuple ) 
     2dup set-suffix checksummed-bits pick 
-    valid-guess? [ drop ] [ 1+ (mint) ] if ;
+    valid-guess? [ drop ] [ 1 + (mint) ] if ;
 
 PRIVATE>
 
-: mint* ( tuple -- str )
+: mint* ( tuple -- stamp )
     0 (mint) string>> ;
 
-: mint ( resource -- str )
+: mint ( resource -- stamp )
     <hashcash>
         swap >>resource
     mint* ;