planet.util
Class Utilities

java.lang.Object
  extended byplanet.util.Utilities

public class Utilities
extends java.lang.Object

Offers different utilities.

Author:
Jordi Pujol

Constructor Summary
Utilities()
           
 
Method Summary
static byte[] generateByteHash(java.lang.String data)
          Generate a hash code from specified data.
static int[] generateIntHash(java.lang.String data)
          Generate a hash code from specified data.
static int[] toIntArray(byte[] data)
          Change a byte array to int array
static int[] toIntArray(java.lang.String data)
          Change a byte array to int array
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utilities

public Utilities()
Method Detail

toIntArray

public static int[] toIntArray(byte[] data)
Change a byte array to int array

Parameters:
data - byte array to change to int array
Returns:
int array from data

toIntArray

public static int[] toIntArray(java.lang.String data)
Change a byte array to int array

Parameters:
data - byte array to change to int array
Returns:
int array from data

generateIntHash

public static int[] generateIntHash(java.lang.String data)
Generate a hash code from specified data. Hash function is SHA-1.

Parameters:
data - String to obtain its hash code.
Returns:
null if no SHA could be obtained, or result of hash function in int array format.

generateByteHash

public static byte[] generateByteHash(java.lang.String data)
Generate a hash code from specified data. Hash function is SHA-1.

Parameters:
data - String to obtain its hash code.
Returns:
null if no SHA could be obtained, or result of hash function in byte array format.