Time for an 2014 update…
This commit is contained in:
parent
372c577f83
commit
09687c4926
2520 changed files with 34227 additions and 7318 deletions
5
Task/CRC-32/FBSL/crc-32.fbsl
Normal file
5
Task/CRC-32/FBSL/crc-32.fbsl
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#APPTYPE CONSOLE
|
||||
|
||||
PRINT HEX(CHECKSUM("The quick brown fox jumps over the lazy dog"))
|
||||
|
||||
PAUSE
|
||||
3
Task/CRC-32/Groovy/crc-32-1.groovy
Normal file
3
Task/CRC-32/Groovy/crc-32-1.groovy
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
def crc32(byte[] bytes) {
|
||||
new java.util.zip.CRC32().with { update bytes; value }
|
||||
}
|
||||
1
Task/CRC-32/Groovy/crc-32-2.groovy
Normal file
1
Task/CRC-32/Groovy/crc-32-2.groovy
Normal file
|
|
@ -0,0 +1 @@
|
|||
assert '414FA339' == sprintf('%04X', crc32('The quick brown fox jumps over the lazy dog'.bytes))
|
||||
|
|
@ -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*/
|
||||
|
|
|
|||
7
Task/CRC-32/Seed7/crc-32.seed7
Normal file
7
Task/CRC-32/Seed7/crc-32.seed7
Normal 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue