Documentation

FixedBitNotation
in package

The FixedBitNotation class is for binary to text conversion. It can handle many encoding schemes, formally defined or not, that use a fixed number of bits to encode each character.

See also: https://github.com/ademarre/binary-to-text-php/commit/d44968b55fada4c1fac0902f7595b23d2814b2f2

Table of Contents

Properties

$_bitsPerCharacter  : mixed
$_charmap  : mixed
$_chars  : mixed
$_padCharacter  : mixed
$_padFinalGroup  : mixed
$_radix  : mixed
$_rightPadFinalBits  : mixed

Methods

__construct()  : mixed
Constructor
decode()  : string|null
Decode a string
encode()  : string
Encode a string

Properties

Methods

__construct()

Constructor

public __construct(int $bitsPerCharacter[, string $chars = null ][, bool $rightPadFinalBits = false ][, bool $padFinalGroup = false ][, string $padCharacter = '=' ]) : mixed
Parameters
$bitsPerCharacter : int

Bits to use for each encoded character

$chars : string = null

Base character alphabet

$rightPadFinalBits : bool = false

How to encode last character

$padFinalGroup : bool = false

Add padding to end of encoded output

$padCharacter : string = '='

Character to use for padding

decode()

Decode a string

public decode(string $encodedString[, bool $caseSensitive = true ][, bool $strict = false ]) : string|null
Parameters
$encodedString : string

Data to decode

$caseSensitive : bool = true
$strict : bool = false

Returns NULL if $encodedString contains an undecodable character

Return values
string|null

encode()

Encode a string

public encode(string $rawString) : string
Parameters
$rawString : string

Binary data to encode

Return values
string
On this page

Search results