lines-crc32 now crcs a \n at the end of each line. it is still off by one \n if the last line doesn't have a newline, but it's good enough for the parser

db4
Doug Coleman 2008-01-05 21:46:39 -06:00
parent de3ea8cc19
commit 3f1370f2b5
1 changed files with 3 additions and 1 deletions

View File

@ -30,4 +30,6 @@ DEFER: crc32-table inline
: file-crc32 ( path -- n ) file-contents crc32 ;
: lines-crc32 ( seq -- n )
HEX: ffffffff tuck [ [ (crc32) ] each ] reduce bitxor ;
HEX: ffffffff tuck [
[ (crc32) ] each CHAR: \n (crc32)
] reduce bitxor ;