dupkey / token
This package is abandoned and no longer maintained.
No replacement package was suggested.
Standardize token generation along with converting to and from string (hex) to binary along with hashing.
1.0.0
2017-09-24 03:25 UTC
Requires
- php: ^7.1
Requires (Dev)
- phpunit/phpunit: ^6.3
This package is not auto-updated.
Last update: 2020-10-21 18:13:34 UTC
README
Token generation, conversion and hashing. Convert to and from string (hexadecimal) or binary.
Installation
composer require dupkey/token
Usage Examples
Generate a new Token.
$token = new Token(int $length = 16);
Get the hexadecimal string of the generated token.
string $token->toString();
(string) $token;
Get the sha512 hash of the token
string $token->getHash();
Create a new Token from a hexadecimal representation.
$token = (new Token)->fromString(string $token);