jeffa has asked for the wisdom of the Perl Monks concerning the following question:
32767 is really just 2^(16-1)-1, but what is up with the first argument to unpack: "%32C*"? The 32C makes sense to me, but the % and the * elude me.$checksum = unpack("%32C*", $foo) % 32767;
Second question is, will the following generate a 64-bit checksum:
? Also, if anybody knows of any good resources on generating checksums, please post them. Thanks in advance.$checksum = unpack("%64C*", $foo) % 2**(64-1)-1
in the meantime, looks like a new Q&A is in order - How do I generate an N-bit checksum?
Jeff
R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
L-L--L-L--L-L--L-L--L-L--L-L--L-L--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: On generating checksums and using unpack
by Albannach (Monsignor) on Apr 24, 2001 at 21:34 UTC | |
|
Re: On generating checksums and using unpack
by dws (Chancellor) on Apr 24, 2001 at 21:17 UTC |