Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Fowler–Noll–Vo hash function
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===FNV-1 hash=== The FNV-1 hash algorithm is as follows:<ref name="FNV_basics">{{Cite journal|last1=Eastlake|first1=Donald|last2=Hansen|first2=Tony|last3=Fowler|first3=Glenn|last4=Vo|first4=Kiem-Phong|last5=<unknown-email-Landon-Noll>|first5=Landon Noll|date=June 4, 2020|title=The FNV Non-Cryptographic Hash Algorithm|url=https://tools.ietf.org/html/draft-eastlake-fnv-17.html|archive-url=|archive-date=|access-date=2020-06-04|website=tools.ietf.org|language=en}}</ref><ref>{{Cite web|title=FNV Hash - The core of the FNV hash|url=http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-1|access-date=2020-06-04|website=www.isthe.com}}</ref> '''algorithm''' fnv-1 '''is''' ''hash'' := '''''FNV_offset_basis''''' '''for each''' ''byte_of_data'' to be hashed '''do''' ''hash'' := ''hash'' × '''''FNV_prime''''' ''hash'' := ''hash'' [[XOR]] ''byte_of_data'' '''return''' ''hash'' In the above [[pseudocode]], all variables are [[signedness|unsigned]] [[integers]]. All variables, except for ''byte_of_data'', have the same number of [[bit]]s as the FNV hash. The variable, ''byte_of_data'', is an 8-[[bit]] unsigned [[integer]]. As an example, consider the 64-[[bit]] FNV-1 hash: * All variables, except for ''byte_of_data'', are 64-[[bit]] unsigned [[integers]]. * The variable, ''byte_of_data'', is an 8-[[bit]] unsigned [[integer]]. * The ''FNV_offset_basis'' is the 64-[[bit]] value: 14695981039346656037 (in hex, 0xcbf29ce484222325). * The ''FNV_prime'' is the 64-[[bit]] value 1099511628211 (in hex, 0x100000001b3). * The [[multiply]] returns the lower 64 [[bit]]s of the [[Product (mathematics)|product]]. * The [[XOR]] is an 8-[[bit]] operation that modifies only the lower 8-[[bit]]s of the hash value. * The ''hash'' value returned is a 64-[[bit]] [[Signedness|unsigned]] [[Integer (computer science)|integer]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)