An implementation of the FNV hashes 1 and 1a of Glenn Fowler, Landon Curt Noll, and Kiem-Phong-Vo, https://en.wikipedia.org/wiki/Fowler–Noll–Vo_hash_function
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | int_hash | = | int32 | |
| logical, | public, | parameter | :: | little_endian | = | (1==transfer([1_int8, 0_int8], 0_int16)) | |
| integer, | private, | parameter | :: | bits_char | = | character_storage_size | |
| integer, | private, | parameter | :: | bits_int16 | = | bit_size(0_int16) | |
| integer, | private, | parameter | :: | bits_int32 | = | bit_size(0_int32) | |
| integer, | private, | parameter | :: | bits_int64 | = | bit_size(0_int64) | |
| integer, | private, | parameter | :: | bits_int8 | = | bit_size(0_int8) | |
| integer, | private, | parameter | :: | bytes_char | = | bits_char/bits_int8 | |
| integer, | private, | parameter | :: | bytes_int16 | = | bits_int16/bits_int8 | |
| integer, | private, | parameter | :: | bytes_int32 | = | bits_int32/bits_int8 | |
| integer, | private, | parameter | :: | bytes_int64 | = | bits_int64/bits_int8 | |
| integer, | private, | parameter | :: | bytes_int8 | = | bits_int8/bits_int8 | |
| integer(kind=int_hash), | private, | parameter | :: | offset_basis | = | int(z'811C9DC5', int_hash) |
The number of bits in the output hash |
| integer(kind=int_hash), | private, | parameter | :: | prime | = | int(z'01000193', int_hash) |
The number of bits in the output hash |
FNV_1 interfaces
FNV_1 hash function for default character string keys
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | key |
FNV_1 hash function for rank 1 array keys of kind int16
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int16), | intent(in) | :: | key(:) |
FNV_1 hash function for rank 1 array keys of kind int32
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | key(:) |
FNV_1 hash function for rank 1 array keys of kind int64
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | key(:) |
FNV_1 hash function for rank 1 array keys of kind int8
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int8), | intent(in) | :: | key(:) |
FNV_1A interfaces
FNV_1A hash function for default character string keys
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | key |
FNV_1A hash function for rank 1 array keys of kind int16
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int16), | intent(in) | :: | key(:) |
FNV_1A hash function for rank 1 array keys of kind int32
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | key(:) |
FNV_1A hash function for rank 1 array keys of kind int64
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | key(:) |
FNV_1A hash function for rank 1 array keys of kind int8
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int8), | intent(in) | :: | key(:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | key |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | key |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int16), | intent(in) | :: | key(:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int16), | intent(in) | :: | key(:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | key(:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | key(:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | key(:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | key(:) |
The original FNV-1 8-bit key algorithm.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int8), | intent(in) | :: | key(:) |
The original FNV-1a 8-bit key algorithm.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int8), | intent(in) | :: | key(:) |