[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/lessphp/SourceMap/ -> Base64VLQ.php (summary)

(no description)

File Size: 187 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Less_SourceMap_Base64VLQ:: (8 methods):
  __construct()
  toVLQSigned()
  fromVLQSigned()
  encode()
  decode()
  zeroFill()
  base64Encode()
  base64Decode()


Class: Less_SourceMap_Base64VLQ  - X-Ref

Encode / Decode Base64 VLQ.

__construct()   X-Ref
Constructor


toVLQSigned($aValue)   X-Ref
Convert from a two-complement value to a value where the sign bit is
is placed in the least significant bit.    For example, as decimals:
1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
We generate the value for 32 bit machines, hence -2147483648 becomes 1, not 4294967297,
even on a 64 bit machine.

param: string $aValue

fromVLQSigned($aValue)   X-Ref
Convert to a two-complement value from a value where the sign bit is
is placed in the least significant bit. For example, as decimals:
2 (10 binary) becomes 1, 3 (11 binary) becomes -1
4 (100 binary) becomes 2, 5 (101 binary) becomes -2
We assume that the value was generated with a 32 bit machine in mind.
Hence
1 becomes -2147483648
even on a 64 bit machine.

param: integer $aValue

encode($aValue)   X-Ref
Return the base 64 VLQ encoded value.

param: string $aValue The value to encode
return: string The encoded value

decode($encoded)   X-Ref
Return the value decoded from base 64 VLQ.

param: string $encoded The encoded value to decode
return: integer The decoded value

zeroFill($a, $b)   X-Ref
Right shift with zero fill.

param: integer $a number to shift
param: integer $b number of bits to shift
return: integer

base64Encode($number)   X-Ref
Encode single 6-bit digit as base64.

param: integer $number
return: string

base64Decode($char)   X-Ref
Decode single 6-bit digit from base64

param: string $char
return: number



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1