FNV.FNV1
Fowler–Noll–Vo hash functions, variant 1 (FNV-1)
Collection of functions to calculate a FNV-1 hash for different bit lengths.
Available functions:
Integer Hashes
- FNV.FNV1.hash_32/1
- FNV.FNV1.hash_64/1
- FNV.FNV1.hash_128/1
- FNV.FNV1.hash_256/1
- FNV.FNV1.hash_512/1
- FNV.FNV1.hash_1024/1
Hexadecimal hashes (strings)
- FNV.FNV1.hex_32/1
- FNV.FNV1.hex_64/1
- FNV.FNV1.hex_128/1
- FNV.FNV1.hex_256/1
- FNV.FNV1.hex_512/1
- FNV.FNV1.hex_1024/1
Summary↑
hash_1024(data) | Returns a 1024 bit integer FNV-1 hash of the input data. Input must be a binary/string |
hash_128(data) | Returns a 128 bit integer FNV-1 hash of the input data. Input must be a binary/string |
hash_256(data) | Returns a 256 bit integer FNV-1 hash of the input data. Input must be a binary/string |
hash_32(data) | Returns a 32 bit integer FNV-1 hash of the input data. Input must be a binary/string |
hash_512(data) | Returns a 512 bit integer FNV-1 hash of the input data. Input must be a binary/string |
hash_64(data) | Returns a 64 bit integer FNV-1 hash of the input data. Input must be a binary/string |
hex_1024(data) | Returns a hexadecimal representation of 1024 bit FNV-1 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-1 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-1 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-1 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-1 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-1 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-1 hash of the input data. Input must be a binary/string.
Example
FNV.FNV1.hash_1024(data)
#=> <integer value>
Returns a 128 bit integer FNV-1 hash of the input data. Input must be a binary/string.
Example
FNV.FNV1.hash_128(data)
#=> <integer value>
Returns a 256 bit integer FNV-1 hash of the input data. Input must be a binary/string.
Example
FNV.FNV1.hash_256(data)
#=> <integer value>
Returns a 32 bit integer FNV-1 hash of the input data. Input must be a binary/string.
Example
FNV.FNV1.hash_32(data)
#=> <integer value>
Returns a 512 bit integer FNV-1 hash of the input data. Input must be a binary/string.
Example
FNV.FNV1.hash_512(data)
#=> <integer value>
Returns a 64 bit integer FNV-1 hash of the input data. Input must be a binary/string.
Example
FNV.FNV1.hash_64(data)
#=> <integer value>
Returns a hexadecimal representation of 1024 bit FNV-1 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.FNV1.hex_1024(data)
#=> "<hex value as string>"
Returns a hexadecimal representation of 128 bit FNV-1 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.FNV1.hex_128(data)
#=> "<hex value as string>"
Returns a hexadecimal representation of 256 bit FNV-1 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.FNV1.hex_256(data)
#=> "<hex value as string>"
Returns a hexadecimal representation of 32 bit FNV-1 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.FNV1.hex_32(data)
#=> "<hex value as string>"
Returns a hexadecimal representation of 512 bit FNV-1 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.FNV1.hex_512(data)
#=> "<hex value as string>"
Returns a hexadecimal representation of 64 bit FNV-1 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.FNV1.hex_64(data)
#=> "<hex value as string>"