crc32
crc32 copied to clipboard
Documentation is wrong
The documentation says that crc32.table() takes a string but it should take an array of character codes
For example the following strings all generate the same result
- "p:1:gbl:HTFWA"
- "p:1:gbl:ZFDFB"
Calling the .table() function by using the exported module function crc32() will return different values for the keys above because it breaks the strings into an array of character codes
We call the .table() function directly because we wanted an int value to use for sharding our keys, because of this issue some shards end up containing a lot more keys than other shards.
Cheers, Alan