Naanou.Common
Class Crypto

Provides consistent cryptographic services for various Naanou components

Field Summary
int HASH_BIT_LENGTH
         Bit length of hash
int MAX_FILE_READ_LENGTH
java.math.BigInteger MOD_BY
         Mod by for fingers
System.Security.Cryptography.SHA1 sha

Constructor Summary
Crypto()
        Initializes a new instance of the Crypto class.

Method Summary
Naanou.Common.Hash Hash(string data)
         Hashes string data
Naanou.Common.Hash Hash(byte[] data)
         Hashes byte array
Naanou.Common.Hash Hash(byte[] data, int offset, int length)
         Hashes part of a byte array
Naanou.Common.Hash Hash(System.IO.FileInfo file)
         Hashes a file
Naanou.Common.Hash HashLargeFile(System.IO.FileInfo file)

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString


Field Detail

HASH_BIT_LENGTH

public int HASH_BIT_LENGTH

Bit length of hash


MAX_FILE_READ_LENGTH

private int MAX_FILE_READ_LENGTH


MOD_BY

public java.math.BigInteger MOD_BY

Mod by for fingers


sha

private System.Security.Cryptography.SHA1 sha

Constructor Detail

Crypto

private Crypto()

Initializes a new instance of the Crypto class.

Method Detail

Hash

public Naanou.Common.Hash Hash(string data)

Hashes string data

Parameters:
data - Data to hash
Returns:
Hash of data

Hash

public Naanou.Common.Hash Hash(byte[] data)

Hashes byte array

Parameters:
data - Data
Returns:
Hash

Hash

public Naanou.Common.Hash Hash(byte[] data,
                               int offset,
                               int length)

Hashes part of a byte array

Parameters:
data - Data
offset - Offset
length - Length
Returns:
Hash

Hash

public Naanou.Common.Hash Hash(System.IO.FileInfo file)

Hashes a file

Parameters:
file -
Returns:

HashLargeFile

private Naanou.Common.Hash HashLargeFile(System.IO.FileInfo file)