Tokenize
class Tokenize (View source)
Methods
static array|null
csrf(int|null $time = null)
Get a csrf token generate
static bool
makeCsrfToken(int|null $time = null)
Csrf token creator
static string
make()
Generate a cryptographically strong token.
static bool
verify(string $token, bool $strict = false)
Check if csrf token is valid
static bool
csrfExpired(int|null $time = null)
Check if the token expires
static void
clear()
Destroy the token
Details
static array|null
csrf(int|null $time = null)
Get a csrf token generate
static bool
makeCsrfToken(int|null $time = null)
Csrf token creator
static string
make()
Generate a cryptographically strong token.
Drawn from 32 bytes (256 bits) of CSPRNG output. The previous version seeded only 6 random bytes mixed with a time/uniqid/rand() salt, so the real entropy floor was ~48 bits and the salt (non-CSPRNG) added none.
static bool
verify(string $token, bool $strict = false)
Check if csrf token is valid
static bool
csrfExpired(int|null $time = null)
Check if the token expires
static void
clear()
Destroy the token