Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

utils.js File Reference

Various helpful functions for in other crypto modules. More...

Functions


Detailed Description

Various helpful functions for in other crypto modules.


Function Documentation

Data bin2base64 Array< int >  data,
bool  changeByteOrder,
bool  padChar
 

Convert data from binary format to base64 encoded string.

Parameters:
data Data to convert.
changeByteOrder If set to *true* change order of bytes.
padChar Character which will be used to pad output. Default "=". (optional)
Returns:
converted to base64 encoded string.

Data bin2hex Array< int >  data,
bool  changeByteOrder
 

Convert data from binary format to hex string.

Parameters:
data Data to convert.
changeByteOrder If set to *true* change order of bytes.
Returns:
converted to hex string.

Data bin2string Array< int >  data,
bool  changeByteOrder,
bool  asWideChar
 

Convert data from binary format to string.

Parameters:
data Data to convert.
changeByteOrder If set to *true* change order of bytes.
asWideChar - if set to *true*, this function will use 16 bits per char, otherwise only 8 bits per char will be used.
Returns:
converted to string.

int bitroll int  x,
int  r
 

Shifts bits in integer right, and perform rounding to 32 bits.

Parameters:
x Integer to shift.
r How much shifts should be dome (must be lower than 32).
Returns:
Value of x w shifted right r times.

Array<int> changeByteOrder Array< int >  data  ) 
 

Changes order of bytes in data between big endian and low endian.

Parameters:
data Data to change.
Returns:
Date with changed byte order.

int madd int  x,
int  y
 

Add two integer with rounding to 32 bits.

Parameters:
x First sum argument.
y Second sum argument.
Returns:
Sum of x and y rounded to 32 bits.

Array<int> string2bin String  data,
bool  changeByteOrder,
bool  isWideChar
 

Convert string to binary format.

Parameters:
data String with data to convert.
changeByteOrder If true change order of bytes.
isWideChar If true, this function will use 16 bit per char, otherwise only 8 bit per char will be used.
Returns:
Data converted to binary format.


Generated on Tue Jan 4 01:03:49 2005 for JabberZilla by  doxygen 1.4.0