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

Fingerprint [constructor]

Construct a fingerprint with a non‐zero starting value.

update

Update the fingerprint with every byte of a string.

update32

Update the fingerprint with 4 bytes at a time.

update64

Update the fingerprint with 8 bytes at a time.

update8

Update the fingerprint with a single byte.

write

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].

Static Member Functions

Name

Description

size

Return the number of uint64s needed to hold the fingerprint value.

Created with MrDocs