Copyright © 2009-2012 Marc Worrell
Authors: Marc Worrell (marc@worrell.nl).
charset() = az | az09 | azAZ09
id/0 | Equivalent to id(?ID_LENGTH) . |
id/1 | Generate a random key consisting of numbers and upper and lower case characters. |
identifier/0 | Equivalent to identifier(?OPTID_LENGTH) . |
identifier/1 | Get a random identifier of a certain length, consisting of lower case characters only. |
number/0 | Equivalent to number(1000000000) . |
number/1 | Return a random integer less than or equal to Max. |
optid/1 | |
rand_bytes/1 | Return N random bytes. |
random_id/2 | Get a random identifier of the specified length, consisting of characters from the specified set: - 'az' [a-z] : lower case characters only. |
sign_key/1 | Get the key for signing requests stored in the user agent. |
sign_key_simple/1 | Get the key for less secure signing of data (without nonce). |
unique/0 | Return an unique id to be used in javascript or html. |
id() -> binary()
Equivalent to id(?ID_LENGTH)
.
id(Length::integer()) -> binary()
Generate a random key consisting of numbers and upper and lower case characters.
The version with the default Length can be used for session ids: the result is sufficiently random and sufficiently unique.identifier() -> binary()
Equivalent to identifier(?OPTID_LENGTH)
.
identifier(Length::integer()) -> binary()
Get a random identifier of a certain length, consisting of lower case characters only.
number() -> integer()
Equivalent to number(1000000000)
.
number(Max::integer()) -> integer()
Return a random integer less than or equal to Max. Max defaults to a large number smaller than MaxInt.
optid(Id::undefined | false | binary()) -> binary()
rand_bytes(N::integer()) -> binary()
Return N random bytes. This falls back to the pseudo random version of rand_uniform if strong_rand_bytes fails.
random_id(X1::charset(), Length::integer()) -> binary()
Get a random identifier of the specified length, consisting of characters from the specified set: - 'az' [a-z] : lower case characters only. - 'az09' [a-z0-9] : lower case characters and numbers only. - 'azAZ09' [a-zA-Z0-9]: lower and upper case characters and numbers.
sign_key(Context::term()) -> binary()
Get the key for signing requests stored in the user agent.
sign_key_simple(Context::term()) -> binary()
Get the key for less secure signing of data (without nonce).
unique() -> binary()
Return an unique id to be used in javascript or html. No randomness, just unique for the current runtime system instance.
Returns a binary of unspecified length starting with the character $t followed by a number of digits, example:<<"t123456">>
.
Note that ids are not unique among connected nodes or after a restart.
Generated by EDoc