Hex

Implements\ParagonIE\ConstantTime\EncoderInterface

Class Hex

package

ParagonIE\ConstantTime

Methods

Convert a hexadecimal string into a binary string without cache-timing leaks

decode(string $encodedString,boolean $strictPadding = false): string
static
Throws
\RangeException

Arguments

$encodedString

string

$strictPadding

boolean

Error on invalid padding

Response

string

(raw binary)

Convert a binary string into a hexadecimal string without cache-timing leaks

encode(string $binString): string
static
Throws
\TypeError

Arguments

$binString

string

(raw binary)

Response

string

Convert a binary string into a hexadecimal string without cache-timing leaks, returning uppercase letters (as per RFC 4648)

encodeUpper(string $binString): string
static
Throws
\TypeError

Arguments

$binString

string

(raw binary)

Response

string