Documentation
¶
Overview ¶
Package userhash provides an obfuscation layer for users in locations.
A userhash allows messages from a given user to be correlated within a channel, but not easily between channels. Specifically, a userhash is based on HMAC with the user ID, channel name, and a value derived from the time as the message content.
The key used to generate hashes must be preserved across program instances.
Userhashes are not intended to guarantee privacy.
Index ¶
Constants ¶
View Source
const Size = 28
Size is the size of a userhash in bytes.
View Source
const TimeQuantum = 15 * time.Minute
TimeQuantum is the duration for which hashing a user and location gives the same result.
Variables ¶
View Source
var ( // ErrShortHash is an error returned when scanning a userhash that is too // short. ErrShortHash = errors.New("short userhash") // ErrHashType is an error returned when scanning a userhash from a type // that cannot be handled. ErrHashType = errors.New("bad type for userhash") )
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.