<s>
The	O
basis	O
of	O
the	O
FNV	B-Error_Name
hash	I-Error_Name
algorithm	O
was	O
taken	O
from	O
an	O
idea	O
sent	O
as	O
reviewer	O
comments	O
to	O
the	O
IEEE	O
POSIX	O
P1003.2	O
committee	O
by	O
Glenn	O
Fowler	O
and	O
Phong	O
Vo	O
in	O
1991	O
.	O
</s>
<s>
In	O
an	O
email	O
message	O
to	O
Landon	O
,	O
they	O
named	O
it	O
the	O
Fowler/Noll/Vo	O
or	O
FNV	B-Error_Name
hash	I-Error_Name
.	O
</s>
<s>
The	O
current	O
versions	O
are	O
FNV-1	B-Error_Name
and	O
FNV-1a	B-Error_Name
,	O
which	O
supply	O
a	O
means	O
of	O
creating	O
non-zero	O
FNV	O
offset	O
basis	O
.	O
</s>
<s>
The	O
FNV	B-Error_Name
hash	I-Error_Name
algorithms	O
and	O
reference	O
FNV	O
source	O
code	O
have	O
been	O
released	O
into	O
the	O
public	O
domain	O
.	O
</s>
<s>
The	O
Python	B-Language
programming	I-Language
language	I-Language
previously	O
used	O
a	O
modified	O
version	O
of	O
the	O
FNV	O
scheme	O
for	O
its	O
default	O
hash	B-Algorithm
function	I-Algorithm
.	O
</s>
<s>
From	O
Python	B-Language
3.4	O
,	O
FNV	O
has	O
been	O
replaced	O
with	O
SipHash	B-Error_Name
to	O
resist	O
"	O
hash	B-Algorithm
flooding	O
"	O
denial-of-service	O
attacks	O
.	O
</s>
<s>
FNV	O
is	O
not	O
a	O
cryptographic	B-Algorithm
hash	I-Algorithm
.	O
</s>
<s>
Start	O
with	O
an	O
initial	O
hash	B-Error_Name
value	I-Error_Name
of	O
FNV	O
offset	O
basis	O
.	O
</s>
<s>
For	O
each	O
byte	O
in	O
the	O
input	O
,	O
multiply	O
hash	B-Algorithm
by	O
the	O
FNV	O
prime	O
,	O
then	O
XOR	B-Application
it	O
with	O
the	O
byte	O
from	O
the	O
input	O
.	O
</s>
<s>
The	O
alternate	O
algorithm	O
,	O
FNV-1a	B-Error_Name
,	O
reverses	O
the	O
multiply	O
and	O
XOR	B-Application
steps	O
.	O
</s>
<s>
The	O
FNV-1	B-Error_Name
hash	B-Error_Name
algorithm	I-Error_Name
is	O
as	O
follows	O
:	O
</s>
<s>
In	O
the	O
above	O
pseudocode	B-Language
,	O
all	O
variables	O
are	O
unsigned	B-Algorithm
integers	I-Algorithm
.	O
</s>
<s>
All	O
variables	O
,	O
except	O
for	O
byte_of_data	O
,	O
have	O
the	O
same	O
number	O
of	O
bits	O
as	O
the	O
FNV	B-Error_Name
hash	I-Error_Name
.	O
</s>
<s>
The	O
variable	O
,	O
byte_of_data	O
,	O
is	O
an	O
8	O
bit	O
unsigned	B-Algorithm
integer	O
.	O
</s>
<s>
As	O
an	O
example	O
,	O
consider	O
the	O
64-bit	O
FNV-1	B-Error_Name
hash	B-Algorithm
:	O
</s>
<s>
All	O
variables	O
,	O
except	O
for	O
byte_of_data	O
,	O
are	O
64-bit	O
unsigned	B-Algorithm
integers	I-Algorithm
.	O
</s>
<s>
The	O
variable	O
,	O
byte_of_data	O
,	O
is	O
an	O
8-bit	O
unsigned	B-Algorithm
integer	O
.	O
</s>
<s>
The	O
XOR	B-Application
is	O
an	O
8-bit	O
operation	O
that	O
modifies	O
only	O
the	O
lower	O
8-bits	O
of	O
the	O
hash	B-Error_Name
value	I-Error_Name
.	O
</s>
<s>
The	O
hash	B-Error_Name
value	I-Error_Name
returned	O
is	O
a	O
64-bit	O
unsigned	B-Algorithm
integer	O
.	O
</s>
<s>
The	O
FNV-1a	B-Error_Name
hash	B-Algorithm
differs	O
from	O
the	O
FNV-1	B-Error_Name
hash	B-Algorithm
by	O
only	O
the	O
order	O
in	O
which	O
the	O
multiply	O
and	O
XOR	B-Application
is	O
performed	O
:	O
</s>
<s>
The	O
above	O
pseudocode	B-Language
has	O
the	O
same	O
assumptions	O
that	O
were	O
noted	O
for	O
the	O
FNV-1	B-Error_Name
pseudocode	B-Language
.	O
</s>
<s>
The	O
FNV-0	B-Error_Name
hash	B-Algorithm
differs	O
from	O
the	O
FNV-1	B-Error_Name
hash	B-Algorithm
only	O
by	O
the	O
initialisation	O
value	O
of	O
the	O
hash	B-Algorithm
variable	O
:	O
</s>
<s>
The	O
above	O
pseudocode	B-Language
has	O
the	O
same	O
assumptions	O
that	O
were	O
noted	O
for	O
the	O
FNV-1	B-Error_Name
pseudocode	B-Language
.	O
</s>
<s>
A	O
consequence	O
of	O
the	O
initialisation	O
of	O
the	O
hash	B-Algorithm
to	O
0	O
is	O
that	O
empty	O
messages	O
and	O
all	O
messages	O
consisting	O
of	O
only	O
the	O
byte	O
0	O
,	O
regardless	O
of	O
their	O
length	O
,	O
hash	B-Algorithm
to	O
0	O
.	O
</s>
<s>
Use	O
of	O
the	O
FNV-0	B-Error_Name
hash	B-Algorithm
is	O
deprecated	B-General_Concept
except	O
for	O
the	O
computing	O
of	O
the	O
FNV	O
offset	O
basis	O
for	O
use	O
as	O
the	O
FNV-1	B-Error_Name
and	O
FNV-1a	B-Error_Name
hash	B-Algorithm
parameters	O
.	O
</s>
<s>
These	O
FNV	O
offset	O
basis	O
are	O
computed	O
by	O
computing	O
the	O
FNV-0	B-Error_Name
from	O
the	O
following	O
32	O
octets	O
when	O
expressed	O
in	O
ASCII	B-Protocol
:	O
</s>
<s>
This	O
is	O
the	O
only	O
current	O
practical	O
use	O
for	O
the	O
deprecated	B-General_Concept
FNV-0	B-Error_Name
.	O
</s>
<s>
They	O
improve	O
the	O
polynomial	O
feedback	O
characteristic	O
when	O
an	O
FNV	O
prime	O
multiplies	O
an	O
intermediate	O
hash	B-Error_Name
value	I-Error_Name
.	O
</s>
<s>
As	O
such	O
,	O
the	O
hash	B-Error_Name
values	I-Error_Name
produced	O
are	O
more	O
scattered	O
throughout	O
the	O
n-bit	O
hash	B-Algorithm
space	O
.	O
</s>
<s>
The	O
above	O
FNV	O
prime	O
constraints	O
and	O
the	O
definition	O
of	O
the	O
FNV	O
offset	O
basis	O
yield	O
the	O
following	O
table	O
of	O
FNV	B-Error_Name
hash	I-Error_Name
parameters	O
:	O
</s>
<s>
The	O
FNV	B-Error_Name
hash	I-Error_Name
was	O
designed	O
for	O
fast	O
hash	B-Algorithm
table	I-Algorithm
and	O
checksum	B-Algorithm
use	O
,	O
not	O
cryptography	O
.	O
</s>
<s>
The	O
authors	O
have	O
identified	O
the	O
following	O
properties	O
as	O
making	O
the	O
algorithm	O
unsuitable	O
as	O
a	O
cryptographic	B-Algorithm
hash	I-Algorithm
function	I-Algorithm
:	O
</s>
<s>
Speed	O
of	O
computation	O
–	O
As	O
a	O
hash	B-Algorithm
designed	O
primarily	O
for	O
hashtable	B-Algorithm
and	O
checksum	B-Algorithm
use	O
,	O
FNV-1	B-Error_Name
and	O
FNV-1a	B-Error_Name
were	O
designed	O
to	O
be	O
fast	O
to	O
compute	O
.	O
</s>
<s>
However	O
,	O
this	O
same	O
speed	O
makes	O
finding	O
specific	O
hash	B-Error_Name
values	I-Error_Name
(	O
collisions	O
)	O
by	O
brute	O
force	O
faster	O
.	O
</s>
<s>
Sticky	O
state	O
–	O
Being	O
an	O
iterative	O
hash	B-Algorithm
based	O
primarily	O
on	O
multiplication	O
and	O
XOR	B-Application
,	O
the	O
algorithm	O
is	O
sensitive	O
to	O
the	O
number	O
zero	O
.	O
</s>
<s>
Specifically	O
,	O
if	O
the	O
hash	B-Error_Name
value	I-Error_Name
were	O
to	O
become	O
zero	O
at	O
any	O
point	O
during	O
calculation	O
,	O
and	O
the	O
next	O
byte	O
hashed	O
were	O
also	O
all	O
zeroes	O
,	O
the	O
hash	B-Algorithm
would	O
not	O
change	O
.	O
</s>
<s>
This	O
makes	O
colliding	O
messages	O
trivial	O
to	O
create	O
given	O
a	O
message	O
that	O
results	O
in	O
a	O
hash	B-Error_Name
value	I-Error_Name
of	O
zero	O
at	O
some	O
point	O
in	O
its	O
calculation	O
.	O
</s>
<s>
Additional	O
operations	O
,	O
such	O
as	O
the	O
addition	O
of	O
a	O
third	O
constant	O
prime	O
on	O
each	O
step	O
,	O
can	O
mitigate	O
this	O
but	O
may	O
have	O
detrimental	O
effects	O
on	O
avalanche	O
effect	O
or	O
random	O
distribution	O
of	O
hash	B-Error_Name
values	I-Error_Name
.	O
</s>
<s>
Diffusion	O
–	O
The	O
ideal	O
secure	B-Algorithm
hash	I-Algorithm
function	I-Algorithm
is	O
one	O
in	O
which	O
each	O
byte	O
of	O
input	O
has	O
an	O
equally-complex	O
effect	O
on	O
every	O
bit	O
of	O
the	O
hash	B-Algorithm
.	O
</s>
<s>
In	O
the	O
FNV	B-Error_Name
hash	I-Error_Name
,	O
the	O
ones	O
place	O
(	O
the	O
rightmost	O
bit	O
)	O
is	O
always	O
the	O
XOR	B-Application
of	O
the	O
rightmost	O
bit	O
of	O
every	O
input	O
byte	O
.	O
</s>
<s>
This	O
can	O
be	O
mitigated	O
by	O
XOR-folding	O
(	O
computing	O
a	O
hash	B-Algorithm
twice	O
the	O
desired	O
length	O
,	O
and	O
then	O
XORing	O
the	O
bits	O
in	O
the	O
"	O
upper	O
half	O
"	O
with	O
the	O
bits	O
in	O
the	O
"	O
lower	O
half	O
"	O
)	O
.	O
</s>
