djb2 0.1.0

Tiny non-cryptographic checksum algorithm by D. J. Bernstein (1991, u32 XOR variant)
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented0 out of 2 items with examples
  • Size
  • Source code size: 4.01 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 543.94 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 14s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • kpcyrd/djb2
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • kpcyrd

This algorithm (k=33) was first reported by dan bernstein many years ago (1991) in comp.lang.c. another version of this algorithm (now favored by bernstein) uses xor: hash(i) = hash(i - 1) * 33 ^ str[i]; the magic of number 33 (why it works better than many other constants, prime or not) has never been adequately explained.

https://www.cse.yorku.ca/~oz/hash.html