Base32

Base32 encryption class

since

1.0

Methods

_mapbin

_mapbin

_mapbin(string $chr) : string

Used with array_map to map the characters from a base32 character set directly into a binary string

access

private

Arguments

$chr

stringThe character to map

Response

stringString of 0's and 1's

_mapcharset

_mapcharset

_mapcharset(string $str) : string

Used with array_map to map the bits from a binary string directly into a base32 character set

access

private

Arguments

$str

stringThe string of 0's and 1's you want to convert

Response

stringResulting base32 character

bin2str

bin2str

bin2str(string $str) : string

Converts a binary string to an ascii string

throws

\Exception

Arguments

$str

stringThe string of 0's and 1's you want to convert

Response

stringThe ascii output

decode

toString

decode(string $str) : string

Convert any base32 string to a normal sctring This should be binary safe...

Arguments

$str

stringThe base32 string to convert

Response

stringThe normal string

encode

fromString

encode(string $str) : string

Convert any string to a base32 string This should be binary safe...

Arguments

$str

stringThe string to convert

Response

stringThe converted base32 string

fromBin

fromBin

fromBin(string $str) : string

Converts a correct binary string to base32

throws

\Exception

Arguments

$str

stringThe string of 0's and 1's you want to convert

Response

stringString encoded as base32

str2bin

str2bin

str2bin(string $str) : string

Converts any ascii string to a binary string

Arguments

$str

stringThe string you want to convert

Response

stringString of 0's and 1's

toBin

toBin

toBin(string $str) : string

Accepts a base32 string and returns an ascii binary string

throws

\Exception

Arguments

$str

stringThe base32 string to convert

Response

stringAscii binary string

Constants

CSRFC3548

CSRFC3548

The character set as defined by RFC3548

Value 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'
link

http://www.ietf.org/rfc/rfc3548.txt

Type(s)