MediaWiki REL1_33
Base32 Class Reference

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. More...

Static Public Member Functions

static decode ($b32)
 Decodes a base32 string into a binary string according to RFC 4648.
 
static encode ($string)
 Encodes a binary string into a base32 string according to RFC 4648 (no padding).
 

Static Private Attributes

static $lut
 

Detailed Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

PHP Google two-factor authentication module.

See http://www.idontplaydarts.com/2011/07/google-totp-two-factor-authentication-for-php/ for more details

Author
Phil

Definition at line 24 of file base32.php.

Member Function Documentation

◆ decode()

static Base32::decode ( $b32)
static

Decodes a base32 string into a binary string according to RFC 4648.

Definition at line 48 of file base32.php.

References and().

Referenced by OATHAuthKey\verifyToken().

◆ encode()

static Base32::encode ( $string)
static

Encodes a binary string into a base32 string according to RFC 4648 (no padding).

Definition at line 80 of file base32.php.

References and().

Referenced by OATHAuthKey\newFromRandom(), and OATHAuthKey\regenerateScratchTokens().

Member Data Documentation

◆ $lut

Base32::$lut
staticprivate
Initial value:
"A" => 0, "B" => 1,
"C" => 2, "D" => 3,
"E" => 4, "F" => 5,
"G" => 6, "H" => 7,
"I" => 8, "J" => 9,
"K" => 10, "L" => 11,
"M" => 12, "N" => 13,
"O" => 14, "P" => 15,
"Q" => 16, "R" => 17,
"S" => 18, "T" => 19,
"U" => 20, "V" => 21,
"W" => 22, "X" => 23,
"Y" => 24, "Z" => 25,
"2" => 26, "3" => 27,
"4" => 28, "5" => 29,
"6" => 30, "7" => 31
)
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))

Definition at line 26 of file base32.php.


The documentation for this class was generated from the following file: