Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

(no description)

File Size: 146 lines (4 kb)
Included or required: 2 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

OTP:: (9 methods):
  __construct()
  getQrCodeUri()
  generateOTP()
  at()
  filterOptions()
  generateURI()
  getDecodedSecret()
  intToByteString()
  compareOTP()


Class: OTP  - X-Ref

__construct($secret, string $digest, int $digits)   X-Ref
OTP constructor.

param: string|null $secret
param: string      $digest
param: int         $digits

getQrCodeUri(string $uri = 'https:)   X-Ref
{@inheritdoc}


generateOTP(int $input)   X-Ref

param: int $input
return: string The OTP at the specified input

at(int $timestamp)   X-Ref
{@inheritdoc}


filterOptions(array &$options)   X-Ref

param: array $options

generateURI(string $type, array $options)   X-Ref

param: string $type
param: array  $options
return: string

getDecodedSecret()   X-Ref

return: string

intToByteString(int $int)   X-Ref

param: int $int
return: string

compareOTP(string $safe, string $user)   X-Ref

param: string $safe
param: string $user
return: bool