Class Transform

Description

An utility class to perform simple byte transformations on data.

Located in /Transform.php (line 48)


	
			
Class Constant Summary
Method Summary
static string fromGUID (string $value)
static string fromHHex (string $value)
static integer fromInt8 (string $value)
static integer fromInt16 (string $value)
static integer fromInt32 (string $value)
static integer fromInt64BE (string $value)
static integer fromInt64LE (string $value)
static string fromLHex (string $value)
static string fromString8 (string $value)
static string fromString16 (string $value)
static string fromString16BE (string $value)
static string fromString16LE (string $value)
static integer fromUInt16BE (string $value)
static integer fromUInt16LE (string $value)
static integer fromUInt32BE (string $value)
static integer fromUInt32LE (string $value)
static string toGUID (string $value)
static string toHHex (string $value)
static integer toInt8 (integer $value)
static string toInt16 (integer $value)
static string toInt32 (integer $value)
static string toInt64BE (integer $value)
static string toInt64LE (integer $value)
static string toLHex (string $value)
static string toString8 (string $value,  $length, [ $padding = "\0"])
static string toString16 (string $value, [integer $order = self::MACHINE_ENDIAN_ORDER])
static string toString16BE (string $value)
static string toString16LE (string $value)
static string toUInt16BE (integer $value)
static string toUInt16LE (integer $value)
static string toUInt32BE (integer $value)
static string toUInt32LE (integer $value)
Methods
static method fromGUID (line 460)

Returns the little-endian ordered binary data as big-endian ordered hexadecimal GUID string.

  • access: public
static string fromGUID (string $value)
  • string $value: The binary data string.
static method fromHHex (line 409)

Returns binary data as hexadecimal string having high nibble first.

  • access: public
static string fromHHex (string $value)
  • string $value: The binary data string.
static method fromInt8 (line 280)

Returns binary data as 8-bit integer.

  • access: public
static integer fromInt8 (string $value)
  • string $value: The binary data string.
static method fromInt16 (line 199)

Returns machine endian ordered binary data as signed 16-bit integer.

  • access: public
static integer fromInt16 (string $value)
  • string $value: The binary data string.
static method fromInt32 (line 130)

Returns machine-endian ordered binary data as signed 32-bit integer.

  • access: public
static integer fromInt32 (string $value)
  • string $value: The binary data string.
static method fromInt64BE (line 106)

Returns big-endian ordered binary data as 64-bit float. PHP does not support 64-bit integers as the long integer is of 32-bits but using aritmetic operations it is implicitly converted into floating point which is of 64-bits long.

  • access: public
static integer fromInt64BE (string $value)
  • string $value: The binary data string.
static method fromInt64LE (line 79)

Returns little-endian ordered binary data as 64-bit float. PHP does not support 64-bit integers as the long integer is of 32-bits but using aritmetic operations it is implicitly converted into floating point which is of 64-bits long.

  • access: public
static integer fromInt64LE (string $value)
  • string $value: The binary data string.
static method fromLHex (line 432)

Returns binary data as hexadecimal string having low nibble first.

  • access: public
static string fromLHex (string $value)
  • string $value: The binary data string.
static method fromString8 (line 302)

Returns binary data as string. Removes terminating zero.

  • access: public
static string fromString8 (string $value)
  • string $value: The binary data string.
static method fromString16 (line 332)

Returns UTF-16 formatted binary data as machine-ordered multibyte string.

The byte order is determined from the byte order mark included in the binary data string.

  • access: public
static string fromString16 (string $value)
  • string $value: The binary data string.
static method fromString16BE (line 384)

Returns big-endian ordered binary data as machine ordered multibyte string.

  • access: public
static string fromString16BE (string $value)
  • string $value: The binary data string.
static method fromString16LE (line 359)

Returns little-endian ordered binary data as machine ordered multibyte string.

  • access: public
static string fromString16LE (string $value)
  • string $value: The binary data string.
static method fromUInt16BE (line 258)

Returns big-endian ordered binary data as unsigned 16-bit integer.

  • access: public
static integer fromUInt16BE (string $value)
  • string $value: The binary data string.
static method fromUInt16LE (line 236)

Returns little-endian ordered binary data as unsigned 16-bit integer.

  • access: public
static integer fromUInt16LE (string $value)
  • string $value: The binary data string.
static method fromUInt32BE (line 176)

Returns big-endian ordered binary data as unsigned 32-bit integer.

  • access: public
static integer fromUInt32BE (string $value)
  • string $value: The binary data string.
static method fromUInt32LE (line 153)

Returns little-endian ordered binary data as unsigned 32-bit integer.

  • access: public
static integer fromUInt32LE (string $value)
  • string $value: The binary data string.
static method toGUID (line 445)

Returns big-endian ordered hexadecimal GUID string as little-endian ordered binary data string.

  • access: public
static string toGUID (string $value)
  • string $value: The input value.
static method toHHex (line 398)

Returns hexadecimal string having high nibble first as binary data.

  • access: public
static string toHHex (string $value)
  • string $value: The input value.
static method toInt8 (line 269)

Returns binary data as 8-bit integer.

  • access: public
static integer toInt8 (integer $value)
  • integer $value: The input value.
static method toInt16 (line 188)

Returns signed 16-bit integer as machine endian ordered binary data.

  • access: public
static string toInt16 (integer $value)
  • integer $value: The input value.
static method toInt32 (line 119)

Returns signed 32-bit integer as machine-endian ordered binary data.

  • access: public
static string toInt32 (integer $value)
  • integer $value: The input value.
static method toInt64BE (line 92)

Returns 64-bit float as big-endian ordered binary data string.

  • access: public
static string toInt64BE (integer $value)
  • integer $value: The input value.
static method toInt64LE (line 65)

Returns 64-bit float as little-endian ordered binary data string.

  • access: public
static string toInt64LE (integer $value)
  • integer $value: The input value.
static method toLHex (line 421)

Returns hexadecimal string having low nibble first as binary data.

  • access: public
static string toLHex (string $value)
  • string $value: The input value.
static method toString8 (line 291)

Returns string as binary data padded to given length with zeros.

  • access: public
static string toString8 (string $value,  $length, [ $padding = "\0"])
  • string $value: The input value.
  • $length
  • $padding
static method toString16 (line 315)

Returns machine-ordered multibyte string as machine-endian ordered binary data

  • access: public
static string toString16 (string $value, [integer $order = self::MACHINE_ENDIAN_ORDER])
  • string $value: The input value.
  • integer $order: The byte order of the binary data string.
static method toString16BE (line 373)

Returns machine ordered multibyte string as big-endian ordered binary data.

  • access: public
static string toString16BE (string $value)
  • string $value: The input value.
static method toString16LE (line 347)

Returns machine-ordered multibyte string as little-endian ordered binary data.

  • access: public
static string toString16LE (string $value)
  • string $value: The input value.
static method toUInt16BE (line 247)

Returns unsigned 16-bit integer as big-endian ordered binary data.

  • access: public
static string toUInt16BE (integer $value)
  • integer $value: The input value.
static method toUInt16LE (line 225)

Returns unsigned 16-bit integer as little-endian ordered binary data.

  • access: public
static string toUInt16LE (integer $value)
  • integer $value: The input value.
static method toUInt32BE (line 165)

Returns unsigned 32-bit integer as big-endian ordered binary data.

  • access: public
static string toUInt32BE (integer $value)
  • integer $value: The input value.
static method toUInt32LE (line 142)

Returns unsigned 32-bit integer as little-endian ordered binary data.

  • access: public
static string toUInt32LE (integer $value)
  • integer $value: The input value.
Class Constants
BIG_ENDIAN_ORDER = 2 (line 52)
LITTLE_ENDIAN_ORDER = 1 (line 51)
MACHINE_ENDIAN_ORDER = 0 (line 50)

Documentation generated on Tue, 15 Apr 2008 03:33:56 +0300 by phpDocumentor 1.4.1