]> gitweb.factorcode.org Git - factor.git/commitdiff
checksums.common: some cleanup, remove unused stuff.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 30 Jun 2016 18:13:51 +0000 (11:13 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 30 Jun 2016 19:30:58 +0000 (12:30 -0700)
basis/checksums/common/common.factor

index f979a6e71900653d47e6f50e19f1c02a0639a2f3..69d6c3ed9def0e54a0b1d4eada26afc86796bd32 100644 (file)
@@ -1,23 +1,14 @@
 ! Copyright (C) 2006, 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel math math.bitwise strings io.binary namespaces
-make grouping byte-arrays ;
+USING: byte-arrays grouping io.binary kernel make math ;
 IN: checksums.common
 
-SYMBOL: bytes-read
-
 : calculate-pad-length ( length -- length' )
     [ 56 < 55 119 ? ] keep - ;
 
-: calculate-pad-length-long ( length -- length' )
-    [ 120 < 119 247 ? ] keep - ;
-
-: pad-last-block ( str big-endian? length -- str )
+: pad-last-block ( bytes big-endian? length -- blocks )
     [
         [ % ] 2dip 0x80 ,
         [ 0x3f bitand calculate-pad-length <byte-array> % ]
         [ 3 shift 8 rot [ >be ] [ >le ] if % ] bi
     ] B{ } make 64 group ;
-
-: update-old-new ( old new -- )
-    [ [ get ] bi@ w+ dup ] 2keep [ set ] bi@ ; inline