]> gitweb.factorcode.org Git - factor.git/commitdiff
fix checksum protocol -- was hardcoded to a block size of 64
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 28 Sep 2009 23:58:20 +0000 (18:58 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 28 Sep 2009 23:58:20 +0000 (18:58 -0500)
core/checksums/checksums.factor

index 5fe46b532f40f9cbe5b54dd08996028a2c65c4af..4c55358e56b50241d1b8f8b28846daf2aeec35c7 100644 (file)
@@ -27,9 +27,9 @@ GENERIC: get-checksum ( checksum -- value )
     over bytes>> [ push-all ] keep
     [ dup length pick block-size>> >= ]
     [
-        64 cut-slice [ >byte-array ] dip [
+        over block-size>> cut-slice [ >byte-array ] dip [
             over [ checksum-block ]
-            [ [ 64 + ] change-bytes-read drop ] bi
+            [ [ ] [ block-size>> ] bi [ + ] curry change-bytes-read drop ] bi
         ] dip
     ] while
     >byte-vector