Class Transform

Description

An utility class to perform simple byte transformations on data.

Located in /Transform.php (line 49)


	
			
Class Constant Summary
Method Summary
static float fromFloat (string $value)
static float fromFloatBE (string $value)
static float fromFloatLE (string $value)
static string fromGUID (string $value)
static string fromHHex (string $value)
static integer fromInt8 (string $value)
static integer fromInt16 (string $value)
static integer fromInt16BE (string $value)
static integer fromInt16LE (string $value)
static integer fromInt32 (string $value)
static integer fromInt32BE (string $value)
static integer fromInt32LE (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, [ &$order = self::MACHINE_ENDIAN_ORDER], integer $order)
static string fromString16BE (string $value)
static string fromString16LE (string $value)
static integer fromUInt8 (string $value)
static integer fromUInt16BE (string $value)
static integer fromUInt16LE (string $value)
static integer fromUInt32BE (string $value)
static integer fromUInt32LE (string $value)
static boolean isBigEndian ()
static boolean isLittleEndian ()
static string toFloat (float $value)
static string toFloatBE (float $value)
static string toFloatLE (float $value)
static string toGUID (string $value)
static string toHHex (string $value)
static integer toInt8 (integer $value)
static string toInt16 (integer $value)
static string toInt16BE (integer $value)
static string toInt16LE (integer $value)
static string toInt32 (integer $value)
static string toInt32BE (integer $value)
static string toInt32LE (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 integer toUInt8 (integer $value)
static string toUInt16BE (integer $value)
static string toUInt16LE (integer $value)
static string toUInt32BE (integer $value)
static string toUInt32LE (integer $value)
Methods
static method fromFloat (line 470)

Returns machine endian ordered binary data as a floating point number.

  • access: public
static float fromFloat (string $value)
  • string $value: The binary data string.
static method fromFloatBE (line 524)

Returns big-endian ordered binary data as a float point number.

  • access: public
static float fromFloatBE (string $value)
  • string $value: The binary data string.
static method fromFloatLE (line 496)

Returns little-endian ordered binary data as a floating point number.

  • access: public
static float fromFloatLE (string $value)
  • string $value: The binary data string.
static method fromGUID (line 732)

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 681)

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 424)

Returns binary data as 8-bit integer.

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

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 fromInt16BE (line 340)

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

  • access: public
static integer fromInt16BE (string $value)
  • string $value: The binary data string.
static method fromInt16LE (line 312)

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

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

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 fromInt32BE (line 205)

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

  • access: public
static integer fromInt32BE (string $value)
  • string $value: The binary data string.
static method fromInt32LE (line 177)

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

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

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 100)

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 704)

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 549)

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 582)

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. The order parameter is updated if a BOM is found.

  • access: public
static string fromString16 (string $value, [ &$order = self::MACHINE_ENDIAN_ORDER], integer $order)
  • string $value: The binary data string.
  • integer $order: The endian to decode using if no BOM was found.
  • &$order
static method fromString16BE (line 655)

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

Removes terminating zero.

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

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

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

Returns binary data as an unsigned 8-bit integer.

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

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 380)

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 258)

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 230)

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 isBigEndian (line 75)

Returns whether the current machine endian order is big endian.

  • access: public
static boolean isBigEndian ()
static method isLittleEndian (line 65)

Returns whether the current machine endian order is little endian.

  • access: public
static boolean isLittleEndian ()
static method toFloat (line 459)

Returns a floating point number as machine endian ordered binary data.

  • access: public
static string toFloat (float $value)
  • float $value: The input value.
static method toFloatBE (line 510)

Returns a floating point number as big-endian ordered binary data.

  • access: public
static string toFloatBE (float $value)
  • float $value: The input value.
static method toFloatLE (line 482)

Returns a floating point number as little-endian ordered binary data.

  • access: public
static string toFloatLE (float $value)
  • float $value: The input value.
static method toGUID (line 717)

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 670)

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 413)

Returns an 8-bit integer as binary data.

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

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 toInt16BE (line 326)

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

  • access: public
static string toInt16BE (integer $value)
  • integer $value: The input value.
static method toInt16LE (line 298)

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

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

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 toInt32BE (line 191)

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

  • access: public
static string toInt32BE (integer $value)
  • integer $value: The input value.
static method toInt32LE (line 163)

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

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

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 86)

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 693)

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 538)

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 563)

Returns machine-ordered multibyte string as UTF-16 defined-order binary data. The byte order is stored using a byte order mask (BOM) in the binary data string.

  • 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 640)

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 610)

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 toUInt8 (line 436)

Returns an unsigned 8-bit integer as binary data.

  • access: public
static integer toUInt8 (integer $value)
  • integer $value: The input value.
static method toUInt16BE (line 391)

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 369)

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 247)

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 219)

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 53)
LITTLE_ENDIAN_ORDER = 1 (line 52)
MACHINE_ENDIAN_ORDER = 0 (line 51)

Documentation generated on Fri, 05 Sep 2008 20:19:57 +0300 by phpDocumentor 1.4.1