Skip to content

Myhash16 #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions doc/specs/stdlib_hash_procedures.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ Landon Curt Noll, and Kiem-Phong Vo;
the *nmhash32* and *nmhash32x* of James Z. M. Gao;
and the *waterhash* of Tommy Ettinger.
The detailed implementation of each algorithm is handled in a separate
submodule: `stdlib_32_bit_fnv_hashes`,
`stdlib_32_bit_nmhashes`, and `stdlib_32_bit_water_hashes`,
submodule: `stdlib_hash_32bit_fnv`,
`stdlib_hash_32bit_nm`, and `stdlib_hash_32bit_water`,
respectively. The `nmhash32`, `nmhash32x`, and `waterhash` algorithms
require seeds. The submodules provide separate seed generators
for each algorithm.
Expand All @@ -381,8 +381,8 @@ Landon Curt Noll, and Kiem-Phong Vo;
the *pengyhash* of Alberto Fajardo;
and the *SpookyHash* of Bob Jenkins.
The detailed implementation of each algorithm is handled in a separate
submodule: `stdlib_64_bit_fnv_hashes`,
`stdlib_64_bit_pengy_hashes`, and `stdlib_64_bit_spooky_hashes`,
submodule: `stdlib_hash_64bit_fnv`,
`stdlib_hash_64bit_pengy`, and `stdlib_hash_64bit_spooky`,
respectively.
The `pengyhash`, and `Spooky Hash` algorithms
require seeds. The submodules provide separate seed generators
Expand All @@ -394,7 +394,7 @@ generating seeds for `universal_mult_hash`.
All assume a two's complement sign bit, and no out of
range checks.

The `stdlib_32_bit_fnv_hashes` and `stdlib_64_bits_fnv_hashes`
The `stdlib_hash_32bit_fnv` and `stdlib_hash_64bit_fnv`
submodules each provide implementations of the FNV-1 and FNV-1A
algorithms in the form of two separate overloaded functions: `FNV_1`
and `FNV_1A`.
Expand All @@ -417,7 +417,7 @@ giving a performance boost where the hashing is intermittent.
[SMHasher discussion](https://github.com/rurban/smhasher/README.md)
and [S. Richter, V. Alvarez, and J. Dittrich. 2015. A Seven-Dimensional Analysis of Hashing Methods and its Implications on Query Processing, Proceedings of the VLDB Endowment, Vol. 9, No. 3.](https://bigdata.uni-saarland.de/publications/p249-richter.pdf) [https://doi.org/10.14778/2850583.2850585](https://doi.org/10.14778/2850583.2850585).

The `stdlib_32_bit_nmhashes` submodule provides implementations
The `stdlib_hash_32bit_nm` submodule provides implementations
of James Z.M. Gao's `nmhash32` and `nmhash32x` algorithms,
version 0.2,
in the form of the overloaded functions, `nmhash32` and `nmhash32x`.
Expand All @@ -434,7 +434,7 @@ seeds, but slower on long seeds, but our limited testing so far shows
`nmhash32x` to be significantly faster on short seeds and slightly
faster on long seeds.

The `stdlib_32_bit_water_hashes` submodule provides implementations
The `stdlib_hash_32bit_water` submodule provides implementations
of Tommy Ettinger's `waterhash` algorithm in the form of the overloaded
function, `water_hash`. Water Hash has not been tested by Reini Urban,
but Tommy Ettinger has tested it with Urban's SMHasher and presents
Expand All @@ -443,14 +443,14 @@ testing hasn't found any bad seeds for the algorithm. To provide
randomly generated seeds for the hash function the submodule also
defines the subroutine `new_water_hash_seed`.

The `stdlib_64_bit_pengy_hashes` submodule provides implementations of
The `stdlib_hash_64bit_pengy` submodule provides implementations of
Alberto Fajardo's `pengyhash` in the form of the overloaded function,
`pengy_hash`. Reini Urban's testing shows that PengyHash passes all
the tests and has no bad seeds. To provide randomly generated seeds
for the hash function the submodule also defines the subroutine
`new_pengy_hash_seed`.

The `stdlib_64_bit_spooky_hashes` submodule provides implementations
The `stdlib_hash_64bit_spooky` submodule provides implementations
of Bob Jenkins' SpookyHash in the form of the overloaded function,
`spooky_hash`. Future implementations may provide the SpookyHash
incremental hashing procedures.
Expand Down
12 changes: 6 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

# Create a list of the files to be preprocessed
set(fppFiles
stdlib_32_bit_fnv_hashes.fypp
stdlib_32_bit_nmhashes.fypp
stdlib_32_bit_water_hashes.fypp
stdlib_64_bit_fnv_hashes.fypp
stdlib_64_bit_pengy_hashes.fypp
stdlib_64_bit_spookyv2_hashes.fypp
stdlib_ascii.fypp
stdlib_bitsets.fypp
stdlib_bitsets_64.fypp
stdlib_bitsets_large.fypp
stdlib_hash_32bit.fypp
stdlib_hash_32bit_fnv.fypp
stdlib_hash_32bit_nm.fypp
stdlib_hash_32bit_water.fypp
stdlib_hash_64bit.fypp
stdlib_hash_64bit_fnv.fypp
stdlib_hash_64bit_pengy.fypp
stdlib_hash_64bit_spookyv2.fypp
stdlib_io.fypp
stdlib_io_npy.fypp
stdlib_io_npy_load.fypp
Expand Down
24 changes: 12 additions & 12 deletions src/Makefile.manual
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
SRCFYPP = \
stdlib_32_bit_fnv_hashes.fypp \
stdlib_32_bit_nmhashes.fypp \
stdlib_32_bit_water_hashes.fypp \
stdlib_64_bit_fnv_hashes.fypp \
stdlib_64_bit_pengy_hashes.fypp \
stdlib_64_bit_spookyv2_hashes.fypp \
stdlib_hash_32bit_fnv.fypp \
stdlib_hash_32bit_nm.fypp \
stdlib_hash_32bit_water.fypp \
stdlib_hash_64bit_fnv.fypp \
stdlib_hash_64bit_pengy.fypp \
stdlib_hash_64bit_spookyv2.fypp \
stdlib_ascii.fypp \
stdlib_bitsets_64.fypp \
stdlib_bitsets_large.fypp \
Expand Down Expand Up @@ -90,21 +90,21 @@ $(SRCGEN): %.f90: %.fypp common.fypp

# Fortran module dependencies
f18estop.o: stdlib_error.o
stdlib_32_bit_fnv_hashes.o: \
stdlib_hash_32bit_fnv.o: \
stdlib_hash_32bit.o
stdlib_hash_32bit.o: \
stdlib_kinds.o
stdlib_32_bit_nmhashes.o: \
stdlib_hash_32bit_nm.o: \
stdlib_hash_32bit.o
stdlib_32_bit_water_hashes.o: \
stdlib_hash_32bit_water.o: \
stdlib_hash_32bit.o
stdlib_64_bit_fnv_hashes.o: \
stdlib_hash_64bit_fnv.o: \
stdlib_hash_64bit.o
stdlib_hash_64bit.o: \
stdlib_kinds.o
stdlib_64_bit_pengy_hashes.o: \
stdlib_hash_64bit_pengy.o: \
stdlib_hash_64bit.o
stdlib_64_bit_spookyv2_hashes.o: \
stdlib_hash_64bit_spookyv2.o: \
stdlib_hash_64bit.o
stdlib_ascii.o: stdlib_kinds.o
stdlib_bitsets.o: stdlib_kinds.o \
Expand Down
Empty file modified src/stdlib_hash_32bit.fypp
100755 → 100644
Empty file.
4 changes: 2 additions & 2 deletions src/stdlib_32_bit_fnv_hashes.fypp → src/stdlib_hash_32bit_fnv.fypp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
!#! Integer kinds to be considered during templating
#:set INT_KINDS = ["int16", "int32", "int64"]

submodule(stdlib_hash_32bit) stdlib_32_bit_fnv_hashes
submodule(stdlib_hash_32bit) stdlib_hash_32bit_fnv
!! 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
Expand Down Expand Up @@ -123,4 +123,4 @@ contains

end function character_fnv_1a

end submodule stdlib_32_bit_fnv_hashes
end submodule stdlib_hash_32bit_fnv
4 changes: 2 additions & 2 deletions src/stdlib_32_bit_nmhashes.fypp → src/stdlib_hash_32bit_nm.fypp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#! Integer kinds to be considered during templating
#:set INT_KINDS = ["int16", "int32", "int64"]

submodule(stdlib_hash_32bit) stdlib_32_bit_nmhashes
submodule(stdlib_hash_32bit) stdlib_hash_32bit_nm

implicit none

Expand Down Expand Up @@ -803,4 +803,4 @@ contains

end subroutine new_nmhash32x_seed

end submodule stdlib_32_bit_nmhashes
end submodule stdlib_hash_32bit_nm
6 changes: 3 additions & 3 deletions src/stdlib_32_bit_water_hashes.fypp → src/stdlib_hash_32bit_water.fypp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
!! For more information, please refer to <http://unlicense.org>
!!
!! `WATER_HASH` is distributed as part of the `stdlib_32_bit_hash_functions.f90`
!! module and its `stdlib_32_bit_water_hashes.f90` submodule with the Fortran
!! module and its `stdlib_hash_32bit_water.f90` submodule with the Fortran
!! Standard Library at URL: https://github.com/fortran-lang/stdlib.
!! The Fortran Standard Library, including this code, is distributed under the
!! MIT License as described in the `LICENSE` file distributed with the library.
Expand Down Expand Up @@ -74,7 +74,7 @@
#! Integer kinds to be considered during templating
#:set INT_KINDS = ["int16", "int32", "int64"]

submodule(stdlib_hash_32bit) stdlib_32_bit_water_hashes
submodule(stdlib_hash_32bit) stdlib_hash_32bit_water
implicit none

contains
Expand Down Expand Up @@ -280,4 +280,4 @@ contains

end subroutine new_water_hash_seed

end submodule stdlib_32_bit_water_hashes
end submodule stdlib_hash_32bit_water
Empty file modified src/stdlib_hash_64bit.fypp
100755 → 100644
Empty file.
4 changes: 2 additions & 2 deletions src/stdlib_64_bit_fnv_hashes.fypp → src/stdlib_hash_64bit_fnv.fypp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#! Integer kinds to be considered during templating
#:set INT_KINDS = ["int16", "int32", "int64"]

submodule(stdlib_hash_64bit) stdlib_64_bit_fnv_hashes
submodule(stdlib_hash_64bit) stdlib_hash_64bit_fnv
! 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
Expand Down Expand Up @@ -122,4 +122,4 @@ contains

end function character_fnv_1a

end submodule stdlib_64_bit_fnv_hashes
end submodule stdlib_hash_64bit_fnv
4 changes: 2 additions & 2 deletions src/stdlib_64_bit_pengy_hashes.fypp → src/stdlib_hash_64bit_pengy.fypp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#! Integer kinds to be considered during templating
#:set INT_KINDS = ["int16", "int32", "int64"]

submodule(stdlib_hash_64bit) stdlib_64_bit_pengy_hashes
submodule(stdlib_hash_64bit) stdlib_hash_64bit_pengy

implicit none

Expand Down Expand Up @@ -146,4 +146,4 @@ contains

end subroutine new_pengy_hash_seed

end submodule stdlib_64_bit_pengy_hashes
end submodule stdlib_hash_64bit_pengy
4 changes: 2 additions & 2 deletions src/stdlib_64_bit_spookyv2_hashes.fypp → src/stdlib_hash_64bit_spookyv2.fypp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#! Integer kinds to be considered during templating
#:set INT_KINDS = ["int16", "int32", "int64"]

submodule(stdlib_hash_64bit) stdlib_64_bit_spookyv2_hashes
submodule(stdlib_hash_64bit) stdlib_hash_64bit_spookyv2

! I have tried to make this portable while retaining efficiency. I assume
! processors with two's complement integers from 8, 16, 32, and 64 bits.
Expand Down Expand Up @@ -712,4 +712,4 @@ contains
end subroutine new_spooky_hash_seed


end submodule stdlib_64_bit_spookyv2_hashes
end submodule stdlib_hash_64bit_spookyv2