Documentation ¶
Overview ¶
Package salted handles salted identifiers.
A salted identifier is a pair consisting of an identifier and a random salt. Salted identifiers are used to prevent malicious agents to guess valid identifiers too easily.
Index ¶
Constants ¶
View Source
const SaltLength = 22
SaltLength is the number of bits of the salt that are really used. The more significant bits are ignored.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Segment ¶
Segment represents a segment encoding an id and a salt. This class is used to encode and decode such segments. The encoded form is a short string that can be used as an URI segment.
func FromRequest ¶
FromRequest creates a Segment from the last segment of the URL of a request.
Click to show internal directories.
Click to hide internal directories.