Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/CRC-32/CoffeeScript/crc-32-1.coffee
Normal file
13
Task/CRC-32/CoffeeScript/crc-32-1.coffee
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
crc32 = do ->
|
||||
table =
|
||||
for n in [0..255]
|
||||
for [0..7]
|
||||
if n & 1
|
||||
n = 0xEDB88320 ^ n >>> 1
|
||||
else
|
||||
n >>>= 1
|
||||
n
|
||||
(str, crc = -1) ->
|
||||
for c in str
|
||||
crc = crc >>> 8 ^ table[(crc ^ c.charCodeAt 0) & 255]
|
||||
(crc ^ -1) >>> 0
|
||||
1
Task/CRC-32/CoffeeScript/crc-32-2.coffee
Normal file
1
Task/CRC-32/CoffeeScript/crc-32-2.coffee
Normal file
|
|
@ -0,0 +1 @@
|
|||
console.log (crc32 'The quick brown fox jumps over the lazy dog').toString 16
|
||||
1
Task/CRC-32/CoffeeScript/crc-32-3.coffee
Normal file
1
Task/CRC-32/CoffeeScript/crc-32-3.coffee
Normal file
|
|
@ -0,0 +1 @@
|
|||
414fa339
|
||||
Loading…
Add table
Add a link
Reference in a new issue