fnv1a
FNV-1a hash implementation for firmware key hashing.
fnv1a_hash(string)
cached
#
Compute FNV-1a 32-bit hash of a string.
This matches the firmware's hash implementation used for parameter and telemetry keys. Results are cached to avoid recomputing hashes for previously seen strings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
string
|
str
|
The string to hash. |
required |
Returns:
| Type | Description |
|---|---|
int
|
32-bit FNV-1a hash value. |
Example
hex(fnv1a_hash("parameter")) '0x100b'
Source code in cogip/utils/fnv1a.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |