Time for an 2014 update…

This commit is contained in:
Ingy döt Net 2014-01-17 05:32:22 +00:00
parent 372c577f83
commit 09687c4926
2520 changed files with 34227 additions and 7318 deletions

View file

@ -0,0 +1,5 @@
#APPTYPE CONSOLE
PRINT HEX(CHECKSUM("The quick brown fox jumps over the lazy dog"))
PAUSE

View file

@ -0,0 +1,3 @@
def crc32(byte[] bytes) {
new java.util.zip.CRC32().with { update bytes; value }
}

View file

@ -0,0 +1 @@
assert '414FA339' == sprintf('%04X', crc32('The quick brown fox jumps over the lazy dog'.bytes))

View file

@ -16,7 +16,7 @@ return
/*──────────────────────────────────CRC_32 subroutine───────────────────*/
CRC_32: procedure; parse arg !,$ /*2nd arg is for multi-invokes. */
do i=0 to 255; z=d2c(i) /*build the 8-bit indexed table.*/
do i=0 for 256; z=d2c(i) /*build the 8-bit indexed table.*/
r=right(z,4,'0'x) /*insure the R is 32 bits. */
do j=0 for 8 /*handle each bit of rightmost 8.*/
rb=x2b(c2x(r)) /*convert char ──► hex ──► binary*/

View file

@ -0,0 +1,7 @@
$ include "seed7_05.s7i";
include "crc32.s7i";
const proc: main is func
begin
writeln(ord(crc32("The quick brown fox jumps over the lazy dog")) radix 16 lpad0 8);
end func;