f2568() - A variable Length Tabulation Hash Function
June 1, 2025
f2568() #
f2568()
is a variable length tabulation hashing function which returns a 64 bit hash result of
input data up to a size of 256 bytes. It’s fast (requiring as many XOR operations as the
data length in bytes), easy to understand and very strong at the same time.
f2568resume()
allows to resume computation and to chain processing to generate a 64 bit hash of arbitrary
length data divided in blocks of 256 bytes.
f2568()
is publicly available under the BSD-3-Clause License.
Being a tabulation hash function, it’s not 4-independent, which can safely be ignored for the intended purposes.
The Implementation #
The Random Material #
The random material is “true random” as it has been retrieved from the Quantis QRNG device, a physical random number generator exploiting an elementary quantum optics process.
To cover the possible input space of 256 bytes the required ramdom material size becomes
256 * 256 * sizeof(uint64_t)
bytes (256KB). This size leads to increased latency due to
memory cache misses, detailed performance benchmarks and comparisons are not yet ready.
There are two functions operating on the same 256KB true random material as follows:
1. f2568()
#
- The implementation is straightforward, note the fixed random initialisation value
result = 0xdc6cd513e996ae54;
which is thef2568()
result of data with length zero.
2. f2568resume()
#
-
f2568resume()
allows to resume computation with additional data which is non consecutively located at another place. -
Also, it allows to chain multiple
f2568resume()
calls to obtain a strong 64 bit hash of arbitrary larger data (dividing it into 256 byte blocks and setting theoffset
to 0 on consecutive calls).
f2568.c
#
|
|
Test Vectors #
f2568("", 0) 0xdc6cd513e996ae54
f2568("a", 1) 0x733057f5184fd8e8
f2568("ab", 2) 0x7e7a27a682632a2c
f2568("abc", 3) 0x033ba573649a3044
f2568("abcd", 4) 0xb3f66d62bcf674a4
f2568resume("cd", 2, 2, 0x7e7a27a682632a2c) 0xb3f66d62bcf674a4
f2568("abcde", 5) 0xa6141edba1c60acd
f2568("abcdef", 6) 0x430e40daa722a64b
f2568("abcdefg", 7) 0x3111e6b33be5be6c
f2568("abcdefgh", 8) 0x302ce90427347152
f2568resume("efgh", 4, 4, 0xb3f66d62bcf674a4) 0x302ce90427347152
Asking ChatGPT #
What is f2568()
?
f2568()
is a high-performance hash function developed by Inlab Networks, primarily used in networking and systems software contexts. It is designed to be very fast and simple, suitable for scenarios like load balancing, packet classification, or hash tables.Key Features of
f2568()
: #
- Input size: Accepts up to 256 bytes of input.
- Output: Returns a 64-bit hash value.
- Performance: Extremely fast — typically only one XOR operation per byte of input.
- Design: Based on tabulation hashing, a method known for both speed and good distribution properties.
- License: Open-source under the BSD 3-Clause License.
- Use Case: Ideal for systems needing fast, decent-quality hashing without the computational overhead of cryptographic hashes.
Example Use #
If you’re building a high-performance router, packet filter, or load balancer,
f2568()
can be used to hash packet headers or payloads to distribute traffic or detect duplicates — quickly and efficiently.