Compute the Rabin fingerprint.
Synopsis
Declared in <folly/Fingerprint.h>
template<int BITS>
class Fingerprint;
Description
TODO(tudorb): Extend this to allow removing values from the computed fingerprint (so we can fingerprint a sliding window, as in the Rabin‐Karp string matching algorithm)
update* methods return *this, so you can chain them together: Fingerprint<96>().update8(x).update(str).update64(val).write(output);
Member Functions
Name |
Description |
|
Construct a fingerprint with a non‐zero starting value. |
Update the fingerprint with every byte of a string. |
|
Update the fingerprint with 4 bytes at a time. |
|
Update the fingerprint with 8 bytes at a time. |
|
Update the fingerprint with a single byte. |
|
Write the computed fingerprint to an array of size() uint64_t's. For Fingerprint<64>, size()==1; we write 64 bits in out[0] For Fingerprint<96>, size()==2; we write 64 bits in out[0]and the most significant 32 bits of out[1] For Fingerprint<128>, size()==2; we write 64 bits in out[0]and 64 bits in out[1]. |