Documentation ¶
Index ¶
Constants ¶
View Source
const ( // FlagDefault marks API keys for default (community) accounts. FlagDefault = 0x0000 // FlagScienceMesh marks API keys for ScienceMesh (partner) accounts. FlagScienceMesh = 0x0001 )
Variables ¶
This section is empty.
Functions ¶
func SaltFromEmail ¶
SaltFromEmail generates a salt-value from an email address.
func SplitAPIKey ¶
SplitAPIKey splits an API key into its pieces: RandomString, Flags and Hash.
func VerifyAPIKey ¶
VerifyAPIKey checks if the API key is valid given the specified salt value.
Types ¶
type SiteIdentifier ¶
type SiteIdentifier = string
SiteIdentifier is the type used to store site identifiers.
func CalculateSiteID ¶
func CalculateSiteID(apiKey APIKey, salt string) (SiteIdentifier, error)
CalculateSiteID calculates a (stable) site ID from the given API key. The site ID is actually the CRC64 hash of the provided API key plus a salt value, thus it is stable for any given key & salt pair.
Click to show internal directories.
Click to hide internal directories.