PubNubCborDecode
in package
Table of Contents
Constants
- ADDITIONAL_LENGTH_1B = 24
- ADDITIONAL_LENGTH_2B = 25
- ADDITIONAL_LENGTH_4B = 26
- ADDITIONAL_LENGTH_8B = 27
- ADDITIONAL_MASK = 0b11111
- ADDITIONAL_TYPE_INDEFINITE = 31
- INDEFINITE_BREAK = 0b11111111
- SIMPLE_VALUE_FALSE = 'F4'
- SIMPLE_VALUE_NULL = 'F6'
- SIMPLE_VALUE_TRUE = 'F5'
- SIMPLE_VALUE_UNDEF = 'F7'
- TYPE_ARRAY = 0b10000000
- TYPE_BYTE_STRING = 0b1000000
- TYPE_FLOAT = 0b11100000
- TYPE_HASHMAP = 0b10100000
- TYPE_MASK = 0b11100000
- TYPE_NEGATIVE_INT = 0b100000
- TYPE_TAG = 0b11000000
- TYPE_TEXT_STRING = 0b1100000
- TYPE_UNSIGNED_INT = 0b0
Properties
- $additionalLength : mixed
- $additionalLengthBytes : mixed
- $simpleValues : mixed
Methods
- decode() : mixed
- Decode incoming hexadecimal string of data and outputing decoded values
- decodeFloat() : mixed
- getData() : mixed
- getIndefiniteData() : mixed
- parseData() : mixed
- sanitizeInput() : string
- Removes spaces, converts string to upper case and throws exception if input is not a valid heaxadecimal string
Constants
ADDITIONAL_LENGTH_1B
public
mixed
ADDITIONAL_LENGTH_1B
= 24
ADDITIONAL_LENGTH_2B
public
mixed
ADDITIONAL_LENGTH_2B
= 25
ADDITIONAL_LENGTH_4B
public
mixed
ADDITIONAL_LENGTH_4B
= 26
ADDITIONAL_LENGTH_8B
public
mixed
ADDITIONAL_LENGTH_8B
= 27
ADDITIONAL_MASK
public
mixed
ADDITIONAL_MASK
= 0b11111
ADDITIONAL_TYPE_INDEFINITE
public
mixed
ADDITIONAL_TYPE_INDEFINITE
= 31
INDEFINITE_BREAK
public
mixed
INDEFINITE_BREAK
= 0b11111111
SIMPLE_VALUE_FALSE
public
mixed
SIMPLE_VALUE_FALSE
= 'F4'
SIMPLE_VALUE_NULL
public
mixed
SIMPLE_VALUE_NULL
= 'F6'
SIMPLE_VALUE_TRUE
public
mixed
SIMPLE_VALUE_TRUE
= 'F5'
SIMPLE_VALUE_UNDEF
public
mixed
SIMPLE_VALUE_UNDEF
= 'F7'
TYPE_ARRAY
public
mixed
TYPE_ARRAY
= 0b10000000
TYPE_BYTE_STRING
public
mixed
TYPE_BYTE_STRING
= 0b1000000
TYPE_FLOAT
public
mixed
TYPE_FLOAT
= 0b11100000
TYPE_HASHMAP
public
mixed
TYPE_HASHMAP
= 0b10100000
TYPE_MASK
public
mixed
TYPE_MASK
= 0b11100000
TYPE_NEGATIVE_INT
public
mixed
TYPE_NEGATIVE_INT
= 0b100000
TYPE_TAG
public
mixed
TYPE_TAG
= 0b11000000
TYPE_TEXT_STRING
public
mixed
TYPE_TEXT_STRING
= 0b1100000
TYPE_UNSIGNED_INT
public
mixed
TYPE_UNSIGNED_INT
= 0b0
Properties
$additionalLength
private
static mixed
$additionalLength
= [self::ADDITIONAL_LENGTH_1B, self::ADDITIONAL_LENGTH_2B, self::ADDITIONAL_LENGTH_4B, self::ADDITIONAL_LENGTH_8B]
$additionalLengthBytes
private
static mixed
$additionalLengthBytes
= [self::ADDITIONAL_LENGTH_1B => 1, self::ADDITIONAL_LENGTH_2B => 2, self::ADDITIONAL_LENGTH_4B => 4, self::ADDITIONAL_LENGTH_8B => 8]
$simpleValues
private
static mixed
$simpleValues
= [self::SIMPLE_VALUE_FALSE => false, self::SIMPLE_VALUE_TRUE => true, self::SIMPLE_VALUE_NULL => null, self::SIMPLE_VALUE_UNDEF => null]
Methods
decode()
Decode incoming hexadecimal string of data and outputing decoded values
public
static decode(string $value) : mixed
Parameters
- $value : string
Tags
decodeFloat()
private
static decodeFloat(mixed $value, mixed $precision) : mixed
Parameters
- $value : mixed
- $precision : mixed
getData()
private
static getData(mixed &$data[, mixed $bytes = 1 ]) : mixed
Parameters
- $data : mixed
- $bytes : mixed = 1
getIndefiniteData()
private
static getIndefiniteData(mixed &$data) : mixed
Parameters
- $data : mixed
parseData()
private
static parseData(mixed &$data) : mixed
Parameters
- $data : mixed
sanitizeInput()
Removes spaces, converts string to upper case and throws exception if input is not a valid heaxadecimal string
private
static sanitizeInput(string $value) : string
Parameters
- $value : string