pic_hash_32bit_fnv Module

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


Uses

  • module~~pic_hash_32bit_fnv~~UsesGraph module~pic_hash_32bit_fnv pic_hash_32bit_fnv iso_fortran_env iso_fortran_env module~pic_hash_32bit_fnv->iso_fortran_env module~pic_types pic_types module~pic_hash_32bit_fnv->module~pic_types module~pic_types->iso_fortran_env iso_c_binding iso_c_binding module~pic_types->iso_c_binding

Used by

  • module~~pic_hash_32bit_fnv~~UsedByGraph module~pic_hash_32bit_fnv pic_hash_32bit_fnv module~pic_hash_32bit pic_hash_32bit module~pic_hash_32bit->module~pic_hash_32bit_fnv

Variables

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


Interfaces

public interface fnv_1_hash

FNV_1 interfaces

  • private elemental module function character_fnv_1(key) result(hash_code)

    FNV_1 hash function for default character string keys

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: key

    Return Value integer(kind=int_hash)

  • private pure module function int16_fnv_1(key) result(hash_code)

    FNV_1 hash function for rank 1 array keys of kind int16

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int16), intent(in) :: key(:)

    Return Value integer(kind=int_hash)

  • private pure module function int32_fnv_1(key) result(hash_code)

    FNV_1 hash function for rank 1 array keys of kind int32

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(in) :: key(:)

    Return Value integer(kind=int_hash)

  • private pure module function int64_fnv_1(key) result(hash_code)

    FNV_1 hash function for rank 1 array keys of kind int64

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(in) :: key(:)

    Return Value integer(kind=int_hash)

  • private pure module function int8_fnv_1(key) result(hash_code)

    FNV_1 hash function for rank 1 array keys of kind int8

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int8), intent(in) :: key(:)

    Return Value integer(kind=int_hash)

public interface fnv_1a_hash

FNV_1A interfaces

  • private elemental module function character_fnv_1a(key) result(hash_value)

    FNV_1A hash function for default character string keys

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: key

    Return Value integer(kind=int_hash)

  • private pure module function int16_fnv_1a(key) result(hash_value)

    FNV_1A hash function for rank 1 array keys of kind int16

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int16), intent(in) :: key(:)

    Return Value integer(kind=int_hash)

  • private pure module function int32_fnv_1a(key) result(hash_value)

    FNV_1A hash function for rank 1 array keys of kind int32

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(in) :: key(:)

    Return Value integer(kind=int_hash)

  • private pure module function int64_fnv_1a(key) result(hash_value)

    FNV_1A hash function for rank 1 array keys of kind int64

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(in) :: key(:)

    Return Value integer(kind=int_hash)

  • private pure module function int8_fnv_1a(key) result(hash_value)

    FNV_1A hash function for rank 1 array keys of kind int8

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int8), intent(in) :: key(:)

    Return Value integer(kind=int_hash)


Functions

private elemental module function character_fnv_1(key) result(hash_code)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: key

Return Value integer(kind=int_hash)

private elemental module function character_fnv_1a(key) result(hash_code)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: key

Return Value integer(kind=int_hash)

private pure module function int16_fnv_1(key) result(hash_code)

Arguments

Type IntentOptional Attributes Name
integer(kind=int16), intent(in) :: key(:)

Return Value integer(kind=int_hash)

private pure module function int16_fnv_1a(key) result(hash_code)

Arguments

Type IntentOptional Attributes Name
integer(kind=int16), intent(in) :: key(:)

Return Value integer(kind=int_hash)

private pure module function int32_fnv_1(key) result(hash_code)

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: key(:)

Return Value integer(kind=int_hash)

private pure module function int32_fnv_1a(key) result(hash_code)

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: key(:)

Return Value integer(kind=int_hash)

private pure module function int64_fnv_1(key) result(hash_code)

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: key(:)

Return Value integer(kind=int_hash)

private pure module function int64_fnv_1a(key) result(hash_code)

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: key(:)

Return Value integer(kind=int_hash)

private pure module function int8_fnv_1(key) result(hash_code)

The original FNV-1 8-bit key algorithm.

Arguments

Type IntentOptional Attributes Name
integer(kind=int8), intent(in) :: key(:)

Return Value integer(kind=int_hash)

private pure module function int8_fnv_1a(key) result(hash_code)

The original FNV-1a 8-bit key algorithm.

Arguments

Type IntentOptional Attributes Name
integer(kind=int8), intent(in) :: key(:)

Return Value integer(kind=int_hash)