crc32 icon indicating copy to clipboard operation
crc32 copied to clipboard

Documentation is wrong

Open aclelland opened this issue 10 years ago • 0 comments

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

aclelland avatar Mar 11 '15 01:03 aclelland