Aplus Framework Docs

Utils
in package

Class Utils.

Table of Contents

base642bin()  : string
Converts a base64 string to binary.
bin2base64()  : string
Converts a binary string to base64.
bin2hex()  : string
Converts a binary string to hexadecimal.
hex2bin()  : string
Converts a hexadecimal string to binary.

Methods

base642bin()

Converts a base64 string to binary.

public static base642bin(string $string[, int $id = SODIUM_BASE64_VARIANT_ORIGINAL ][, string $ignore = '' ]) : string
Parameters
$string : string
$id : int = SODIUM_BASE64_VARIANT_ORIGINAL
$ignore : string = ''
Tags
throws
SodiumException
Return values
string

The binary string

bin2base64()

Converts a binary string to base64.

public static bin2base64(string $string[, int $id = SODIUM_BASE64_VARIANT_ORIGINAL ]) : string
Parameters
$string : string
$id : int = SODIUM_BASE64_VARIANT_ORIGINAL
Tags
throws
SodiumException
Return values
string

The base64 encoded string

bin2hex()

Converts a binary string to hexadecimal.

public static bin2hex(string $string) : string
Parameters
$string : string
Tags
throws
SodiumException
Return values
string

The hexadecimal string

hex2bin()

Converts a hexadecimal string to binary.

public static hex2bin(string $string[, string $ignore = '' ]) : string
Parameters
$string : string
$ignore : string = ''
Tags
throws
SodiumException
Return values
string

The binary string

Search results