Skip to main content

Module hash

Module hash 

Source
Expand description

Hashes and random ids.

Functions§

hex
Lower case hex of bytes.
hmac
HMAC-SHA-256 of text under key, as hex.
new_id
A random id of twelve bytes, the SDK’s default.
random_bytes
Random bytes from the system.
random_id
A random id: bytes random bytes as hex.
random_salt
A new day’s salt.
sha256
SHA-256 of the text, as hex.
visitor_hash
The day’s visitor hash: SHA-256 of salt, site, IP, and user agent, cut to 64 bits. The salt changes every day and old salts are deleted, so the hash cannot be recomputed and does not follow anyone across days.