PHP Class FOF30\Encrypt\Base32

Datei anzeigen Open project: akeeba/fof Class Usage Examples

Public Methods

Method Description
decode ( string $str ) : string Convert any base32 string to a normal sctring This should be binary safe.
encode ( string $str ) : string Convert any string to a base32 string This should be binary safe.

Private Methods

Method Description
bin2str ( string $str ) : string Converts a binary string to an ascii string
fromBin ( string $str ) : string Converts a correct binary string to base32
mapBin ( string $chr ) : string Used with array_map to map the characters from a base32 character set directly into a binary string
mapCharset ( string $str ) : string Used with array_map to map the bits from a binary string directly into a base32 character set
str2bin ( string $str ) : string Converts any ascii string to a binary string
toBin ( string $str ) : string Accepts a base32 string and returns an ascii binary string

Method Details

decode() public method

..
public decode ( string $str ) : string
$str string The base32 string to convert
return string The normal string

encode() public method

..
public encode ( string $str ) : string
$str string The string to convert
return string The converted base32 string