]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/checksums/crc16/crc16.factor
endian: replaces io.binary and io.binary.fast.
[factor.git] / basis / checksums / crc16 / crc16.factor
index 415a4090a4a3b00ee4fec99639ea36e31faf3832..0097b07c940bb4a58697ec0cb83574597be5de75 100644 (file)
@@ -1,7 +1,6 @@
 ! Copyright (C) 2016 Alexander Ilin.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: checksums io.binary kernel math sequences
-sequences.private ;
+USING: checksums endian kernel math sequences sequences.private ;
 IN: checksums.crc16
 
 CONSTANT: crc16-polynomial 0xa001
@@ -16,7 +15,7 @@ CONSTANT: crc16-table V{ }
 
 : (crc16) ( crc ch -- crc )
     dupd bitxor
-    mask-byte crc16-table nth-unsafe
+    0xff bitand crc16-table nth-unsafe
     swap -8 shift bitxor ; inline
 
 SINGLETON: crc16