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

Hexadecimal hashes (strings)

Source

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

hash_1024(data)

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>
Source
hash_128(data)

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>
Source
hash_256(data)

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>
Source
hash_32(data)

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>
Source
hash_512(data)

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>
Source
hash_64(data)

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>
Source
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.

Example

FNV.FNV1.hex_1024(data)
#=> "<hex value as string>"
Source
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.

Example

FNV.FNV1.hex_128(data)
#=> "<hex value as string>"
Source
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.

Example

FNV.FNV1.hex_256(data)
#=> "<hex value as string>"
Source
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.

Example

FNV.FNV1.hex_32(data)
#=> "<hex value as string>"
Source
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.

Example

FNV.FNV1.hex_512(data)
#=> "<hex value as string>"
Source
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.

Example

FNV.FNV1.hex_64(data)
#=> "<hex value as string>"
Source