randomToken

Generates a random token. Useful for temporary one-use URLs, such as in email confirmations.

The strength is the number of bytes of randomness in the token. Note this is NOT the length of the token string returned, since this token is base64-encoded (using an entirely URI-safe version that doesn't need escaping) from the raw random bytes.

The strength must be a multiple of 4, or this will throw an Exception

More...
  1. string randomToken(size_t strength)
    string
    randomToken
  2. string randomToken(Rand rand, size_t strength)

Detailed Description

Optional Params

Rand - Default value is 'DefaultCryptoRand'

strength - Default value is 'defaultTokenStrength'

Meta