1 ! Copyright (C) 2008 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: checksums kernel math ranges math.vectors sequences ;
8 CONSTANT: adler-32-modulus 65521
10 M: adler-32 checksum-bytes
13 [ [ dup length [1..b] <reversed> vdot ] [ length ] bi + ] bi
14 [ adler-32-modulus mod ] bi@ 16 shift bitor ;
16 INSTANCE: adler-32 checksum