]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/crypto/passwd-md5/passwd-md5.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / extra / crypto / passwd-md5 / passwd-md5.factor
index e292981876dcd60a9ad6d882183da8398432e436..30650c1e401daa806ef75eeb5e84cf6631359f9c 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel base64 checksums.md5 sequences checksums
-locals prettyprint math math.bitwise grouping io combinators
+locals prettyprint math math.bits grouping io combinators
 fry make combinators.short-circuit math.functions splitting ;
 IN: crypto.passwd-md5
 
@@ -11,7 +11,7 @@ IN: crypto.passwd-md5
     "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" nth ; inline
 
 : to64 ( v n -- string )
-    [ [ -6 shift ] [ 6 2^ 1- bitand lookup-table ] bi ]
+    [ [ -6 shift ] [ 6 2^ 1 - bitand lookup-table ] bi ]
     replicate nip ; inline
 
 PRIVATE>
@@ -22,8 +22,8 @@ PRIVATE>
                 password length
                 [ 16 / ceiling swap <repetition> concat ] keep
                 head-slice append
-                password [ length ] [ first ] bi
-                '[ [ CHAR: \0 _ ? , ] each-bit ] "" make append
+                password [ length make-bits ] [ first ] bi
+                '[ CHAR: \0 _ ? ] "" map-as append
                 md5 checksum-bytes ] |
         1000 [
             "" swap