CRC-32: Difference between revisions

11 bytes removed ,  3 years ago
→‎Lisp Code: Use newer style iteration.
(→‎{{header|TXR}}: Add FFI-to-Zlib version.)
(→‎Lisp Code: Use newer style iteration.)
Line 2,271:
(let ((crc #xffffffff)
(l (len buf)))
(foreach ((i 0)) ((< i ..l) (logxor crc #xffffffff)) ((inc i))
(set crc (logxor [crc-tab (logand (logxor crc [buf i]) #xff)]
(ash crc -8))))))</lang>
(logxor crc #xffffffff)))</lang>
 
{{out}}
<pre>$ ./txr -i crc.tl
543

edits