POT
POT
POT
Main menu

Download

Forum

SVN

Class: OTS_BinaryTools

Source Location: /classes/OTS_BinaryTools.php

Class OTS_BinaryTools

Class Overview

This is class similar to OTS_Toolbox except that this class contains routines for binary number operations.

This is class similar to OTS_Toolbox except that this class contains routines for binary number operations. It is mainly used by encryption/decryption classes so you are probably not interested in using it.

Located in /classes/OTS_BinaryTools.php [line 20]



		
				Author(s):
		
Information Tags:
Version:  0.1.2
Since:  0.1.2

Methods

[ Top ]
Method Summary
static string   bin2Int()   Transforms binary representation of large integer into string.
static string   int2Bin()   Transforms large integer into binary string.
static int   unsignedAdd()   Handle proper unsigned add, dealing with PHP's signed add.
static int   unsignedRightShift()   Handle proper unsigned right shift, dealing with PHP's signed shift.

[ Top ]
Methods
static method bin2Int  [line 113]

  static string bin2Int( string $string  )

Transforms binary representation of large integer into string.

Transforms binary representation of large integer into string.

Parameters:
string   $string:  Binary string.

API Tags:
Return:  Numeric representation.
Access:  public

Information Tags:
Version:  0.1.2
Since:  0.1.2

[ Top ]
static method int2Bin  [line 133]

  static string int2Bin( string $number  )

Transforms large integer into binary string.

Transforms large integer into binary string.

Parameters:
string   $number:  Large integer.

API Tags:
Return:  Binary string.
Access:  public

Information Tags:
Version:  0.1.2
Since:  0.1.2

[ Top ]
static method unsignedAdd  [line 73]

  static int unsignedAdd( int $a, int $b  )

Handle proper unsigned add, dealing with PHP's signed add.

Handle proper unsigned add, dealing with PHP's signed add.

Parameters:
int   $a:  First number.
int   $b:  Second number.

API Tags:
Return:  Unsigned sum.
Access:  public

Information Tags:
Version:  0.1.2
Since:  0.1.2

[ Top ]
static method unsignedRightShift  [line 29]

  static int unsignedRightShift( int $integer, int $n  )

Handle proper unsigned right shift, dealing with PHP's signed shift.

Handle proper unsigned right shift, dealing with PHP's signed shift.

Parameters:
int   $integer:  Number to be shifted.
int   $n:  Number of bits to shift.

API Tags:
Return:  Shifted integer.
Access:  public

Information Tags:
Version:  0.1.2
Since:  0.1.2

[ Top ]