CRC-32: Difference between revisions
Content added Content deleted
(→{{header|PARI/GP}}: append Free Pascal . CRC is the unit to use. ala https://forum.lazarus.freepascal.org/index.php/topic,36396.msg242520.html) |
(add RPL) |
||
Line 2,398: | Line 2,398: | ||
hex CRC-32 checksum = D1370232 dec CRC-32 checksum = 3510043186 |
hex CRC-32 checksum = D1370232 dec CRC-32 checksum = 3510043186 |
||
</pre> |
|||
=={{header|RPL}}== |
|||
{{trans|FreeBASIC}} |
|||
≪ → string |
|||
≪ <span style="color:red">32</span> STWS <span style="color:grey">@ set binary word size to 32</span> |
|||
'''IFERR''' ‘<span style="color:green">CRCtable</span>’ RCL '''THEN''' |
|||
{ } |
|||
<span style="color:red">0 255</span> '''FOR''' j |
|||
j R→B |
|||
<span style="color:red">0 7</span> '''START''' |
|||
SR '''IF''' LAST <span style="color:red">#1</span> AND B→R '''THEN''' <span style="color:red">#EDB88320h</span> XOR '''END''' |
|||
'''NEXT''' + '''NEXT''' |
|||
‘<span style="color:green">CRCtable</span>’ STO |
|||
'''END''' |
|||
DROP <span style="color:red">#0</span> NOT |
|||
<span style="color:red">1</span> string SIZE '''FOR''' j |
|||
SRB SWAP |
|||
<span style="color:red">#FFh</span> AND string j DUP SUB NUM R→B XOR |
|||
B→R <span style="color:red">1</span> + ‘<span style="color:green">CRCtable</span>’ SWAP GET XOR |
|||
'''NEXT''' |
|||
NOT |
|||
≫ ≫ ‘<span style="color:blue">CRC32</span>’ STO |
|||
<span style="color:red">"The quick brown fox jumps over the lazy dog"</span> <span style="color:blue">CRC32</span> |
|||
{{out}} |
|||
<pre> |
|||
1: # 414FA339h |
|||
</pre> |
</pre> |
||