1 ! Copyright (C) 2008 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: checksums classes.singleton kernel math math.ranges
4 math.vectors sequences ;
9 : adler-32-modulus 65521 ; inline
11 M: adler-32 checksum-bytes ( bytes checksum -- value )
14 [ [ dup length [1,b] <reversed> v. ] [ length ] bi + ] bi
15 [ adler-32-modulus mod ] bi@ 16 shift bitor ;