FNV.FNV1a
Fowler–Noll–Vo hash functions, variant 1a (FNV-1a)
Collection of functions to calculate a FNV-1a hash for different bit lengths.
Available functions:
Integer Hashes
- FNV.FNV1a.hash_32/1
- FNV.FNV1a.hash_64/1
- FNV.FNV1a.hash_128/1
- FNV.FNV1a.hash_256/1
- FNV.FNV1a.hash_512/1
- FNV.FNV1a.hash_1024/1
Hexadecimal hashes (strings)
- FNV.FNV1a.hex_32/1
- FNV.FNV1a.hex_64/1
- FNV.FNV1a.hex_128/1
- FNV.FNV1a.hex_256/1
- FNV.FNV1a.hex_512/1
- FNV.FNV1a.hex_1024/1
Summary↑
hash_1024(data) | Returns a 1024 bit integer FNV-1a hash of the input data. Input must be a binary/string |
hash_128(data) | Returns a 128 bit integer FNV-1a hash of the input data. Input must be a binary/string |
hash_256(data) | Returns a 256 bit integer FNV-1a hash of the input data. Input must be a binary/string |
hash_32(data) | Returns a 32 bit integer FNV-1a hash of the input data. Input must be a binary/string |
hash_512(data) | Returns a 512 bit integer FNV-1a hash of the input data. Input must be a binary/string |
hash_64(data) | Returns a 64 bit integer FNV-1a hash of the input data. Input must be a binary/string |
hex_1024(data) | Returns a hexadecimal representation of 1024 bit FNV-1a hash of the input data. The result will always have 256 hex digits (with leading zeros as padding). Input must be a binary/string |
hex_128(data) | Returns a hexadecimal representation of 128 bit FNV-1a hash of the input data. The result will always have 32 hex digits (with leading zeros as padding). Input must be a binary/string |
hex_256(data) | Returns a hexadecimal representation of 256 bit FNV-1a hash of the input data. The result will always have 64 hex digits (with leading zeros as padding). Input must be a binary/string |
hex_32(data) | Returns a hexadecimal representation of 32 bit FNV-1a hash of the input data. The result will always have 8 hex digits (with leading zeros as padding). Input must be a binary/string |
hex_512(data) | Returns a hexadecimal representation of 512 bit FNV-1a hash of the input data. The result will always have 128 hex digits (with leading zeros as padding). Input must be a binary/string |
hex_64(data) | Returns a hexadecimal representation of 64 bit FNV-1a hash of the input data. The result will always have 16 hex digits (with leading zeros as padding). Input must be a binary/string |
Functions
Returns a 1024 bit integer FNV-1a hash of the input data. Input must be a binary/string.
Example
FNV.FNV1a.hash_1024(data)
#=> <integer value>
Returns a 128 bit integer FNV-1a hash of the input data. Input must be a binary/string.
Example
FNV.FNV1a.hash_128(data)
#=> <integer value>
Returns a 256 bit integer FNV-1a hash of the input data. Input must be a binary/string.
Example
FNV.FNV1a.hash_256(data)
#=> <integer value>
Returns a 32 bit integer FNV-1a hash of the input data. Input must be a binary/string.
Example
FNV.FNV1a.hash_32(data)
#=> <integer value>
Returns a 512 bit integer FNV-1a hash of the input data. Input must be a binary/string.
Example
FNV.FNV1a.hash_512(data)
#=> <integer value>
Returns a 64 bit integer FNV-1a hash of the input data. Input must be a binary/string.
Example
FNV.FNV1a.hash_64(data)
#=> <integer value>
Returns a hexadecimal representation of 1024 bit FNV-1a hash of the input data. The result will always have 256 hex digits (with leading zeros as padding). Input must be a binary/string.
Example
FNV.FNV1a.hex_1024(data)
#=> "<hex value as string>"
Returns a hexadecimal representation of 128 bit FNV-1a hash of the input data. The result will always have 32 hex digits (with leading zeros as padding). Input must be a binary/string.
Example
FNV.FNV1a.hex_128(data)
#=> "<hex value as string>"
Returns a hexadecimal representation of 256 bit FNV-1a hash of the input data. The result will always have 64 hex digits (with leading zeros as padding). Input must be a binary/string.
Example
FNV.FNV1a.hex_256(data)
#=> "<hex value as string>"
Returns a hexadecimal representation of 32 bit FNV-1a hash of the input data. The result will always have 8 hex digits (with leading zeros as padding). Input must be a binary/string.
Example
FNV.FNV1a.hex_32(data)
#=> "<hex value as string>"
Returns a hexadecimal representation of 512 bit FNV-1a hash of the input data. The result will always have 128 hex digits (with leading zeros as padding). Input must be a binary/string.
Example
FNV.FNV1a.hex_512(data)
#=> "<hex value as string>"
Returns a hexadecimal representation of 64 bit FNV-1a hash of the input data. The result will always have 16 hex digits (with leading zeros as padding). Input must be a binary/string.
Example
FNV.FNV1a.hex_64(data)
#=> "<hex value as string>"