Random numbers and data
Returns a 32 bit random integer.
length hex-encoded bytes of random data.
length is not specified, this function will return an amount of data suitable for use as a secret key.
length Base64-encoded bytes of data.
length bytes of random data, encoded using a modified Base64 encoding suitable for use in URLs.
length is not specified, this function will return an amount of data suitable for use as a secret key in a URL. If you are using this function for this application, you are recommended not to pass in a length and use the default. The default may change over time to meet revised security guidelines.
For compatibility with email clients and other applications which perform non-optimal URL auto-linking, the identifiers will never start or end with a character that is not alphanumeric. This very slightly reduces the amount of entropy in generated API keys.