RFC4648

Class RFC4648

This class conforms strictly to the RFC

package

ParagonIE\ConstantTime

Methods

RFC 4648 Base16 decoding

base16Decode(string $str): string
static

"666F6F" -> "foo"

Arguments

$str

string

Response

string

RFC 4648 Base16 decoding

base16Encode(string $str): string
static

"foo" -> "666F6F"

Throws
\TypeError

Arguments

$str

string

Response

string

RFC 4648 Base32 encoding

base32Decode(string $str): string
static

"MZXW6===" -> "foo"

Throws
\TypeError

Arguments

$str

string

Response

string

RFC 4648 Base32 encoding

base32Encode(string $str): string
static

"foo" -> "MZXW6==="

Throws
\TypeError

Arguments

$str

string

Response

string

RFC 4648 Base32-Hex decoding

base32HexDecode(string $str): string
static

"CPNMU===" -> "foo"

Throws
\TypeError

Arguments

$str

string

Response

string

RFC 4648 Base32-Hex encoding

base32HexEncode(string $str): string
static

"foo" -> "CPNMU==="

Throws
\TypeError

Arguments

$str

string

Response

string

RFC 4648 Base64 decoding

base64Decode(string $str): string
static

"Zm9v" -> "foo"

Throws
\TypeError

Arguments

$str

string

Response

string

RFC 4648 Base64 encoding

base64Encode(string $str): string
static

"foo" -> "Zm9v"

Throws
\TypeError

Arguments

$str

string

Response

string

RFC 4648 Base64 (URL Safe) decoding

base64UrlSafeDecode(string $str): string
static

"Zm9v" -> "foo"

Throws
\TypeError

Arguments

$str

string

Response

string

RFC 4648 Base64 (URL Safe) encoding

base64UrlSafeEncode(string $str): string
static

"foo" -> "Zm9v"

Throws
\TypeError

Arguments

$str

string

Response

string