at.molindo.utils.data
Class Hash

java.lang.Object
  extended by at.molindo.utils.data.Hash

public class Hash
extends Object


Nested Class Summary
static class Hash.Algorithm
           
static interface Hash.IAlgorithm
           
static interface Hash.IHashBuilder
           
 
Constructor Summary
Hash(byte[] bytes, Hash.IAlgorithm algorithm)
           
Hash(String hex, Hash.IAlgorithm algorithm)
           
 
Method Summary
 boolean equals(Object obj)
           
 Hash.IAlgorithm getAlgorithm()
           
 byte[] getBytes()
           
static Hash hash(Hash.Algorithm algorithm, byte[] content)
           
static Hash hash(Hash.Algorithm algorithm, String content)
           
 int hashCode()
           
static Hash md5(byte[] content)
           
static Hash md5(String content)
           
static Hash sha256(byte[] content)
           
static Hash sha256(String content)
           
static Hash sha512(byte[] content)
           
static Hash sha512(String content)
           
 String toHex()
           
 String toString()
           
 boolean validate(byte[] content)
           
 boolean validate(String content)
           
 boolean validate(String content, Charset charset)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Hash

public Hash(String hex,
            Hash.IAlgorithm algorithm)

Hash

public Hash(byte[] bytes,
            Hash.IAlgorithm algorithm)
Method Detail

md5

public static Hash md5(String content)

md5

public static Hash md5(byte[] content)

sha256

public static Hash sha256(String content)

sha256

public static Hash sha256(byte[] content)

sha512

public static Hash sha512(String content)

sha512

public static Hash sha512(byte[] content)

hash

public static Hash hash(Hash.Algorithm algorithm,
                        String content)

hash

public static Hash hash(Hash.Algorithm algorithm,
                        byte[] content)

toHex

public String toHex()

getAlgorithm

public Hash.IAlgorithm getAlgorithm()

getBytes

public byte[] getBytes()

toString

public String toString()
Overrides:
toString in class Object

validate

public boolean validate(String content)

validate

public boolean validate(String content,
                        Charset charset)

validate

public boolean validate(byte[] content)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2011 Molindo GmbH. All Rights Reserved.