1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace OCA\FederatedFileSharing;
- use OCP\Security\ISecureRandom;
- class TokenHandler {
- public const TOKEN_LENGTH = 15;
-
- public function __construct(
- private ISecureRandom $secureRandom,
- ) {
- }
-
- public function generateToken() {
- $token = $this->secureRandom->generate(
- self::TOKEN_LENGTH,
- ISecureRandom::CHAR_ALPHANUMERIC);
- return $token;
- }
- }
|