hashcash: quick fix for string argument to checksum-bytes.
parent
8d61ace2b4
commit
58dd52e82e
|
@ -1,8 +1,9 @@
|
||||||
! Copyright (C) 2009 Diego Martinelli.
|
! Copyright (C) 2009 Diego Martinelli.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors byte-arrays calendar calendar.format checksums
|
USING: accessors calendar calendar.format checksums
|
||||||
checksums.openssl classes.tuple fry kernel make math math.functions
|
checksums.openssl classes.tuple fry io.encodings.ascii
|
||||||
math.parser math.ranges present random sequences splitting strings ;
|
io.encodings.string kernel math math.functions math.parser
|
||||||
|
math.ranges present random sequences splitting ;
|
||||||
IN: hashcash
|
IN: hashcash
|
||||||
|
|
||||||
! Hashcash implementation
|
! Hashcash implementation
|
||||||
|
@ -49,7 +50,7 @@ M: hashcash string>>
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
: sha1-checksum ( str -- bytes )
|
: sha1-checksum ( str -- bytes )
|
||||||
openssl-sha1 checksum-bytes ; inline
|
ascii encode openssl-sha1 checksum-bytes ; inline
|
||||||
|
|
||||||
: set-suffix ( tuple guess -- tuple )
|
: set-suffix ( tuple guess -- tuple )
|
||||||
>hex >>suffix ;
|
>hex >>suffix ;
|
||||||
|
|
Loading…
Reference in New Issue