com.cedarsoft.crypt
Class Hash

java.lang.Object
  extended by com.cedarsoft.crypt.Hash
All Implemented Interfaces:
Serializable

public class Hash
extends Object
implements Serializable

Represents a hash value

See Also:
Serialized Form

Constructor Summary
Hash(Algorithm algorithm, byte[] value)
           
 
Method Summary
 boolean equals(Object o)
           
static Hash fromHex(Algorithm algorithm, String valueAsHex)
          Creates a hash from the given hex value
 Algorithm getAlgorithm()
           
 byte[] getValue()
           
 String getValueAsHex()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Hash

public Hash(@NotNull
            Algorithm algorithm,
            @NotNull
            byte[] value)
Method Detail

getAlgorithm

@NotNull
public Algorithm getAlgorithm()

getValueAsHex

@NotNull
public String getValueAsHex()

getValue

@NotNull
public byte[] getValue()

toString

@NonNls
public String toString()
Overrides:
toString in class Object

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

fromHex

@NotNull
public static Hash fromHex(@NotNull
                                   Algorithm algorithm,
                                   @NotNull
                                   String valueAsHex)
Creates a hash from the given hex value

Parameters:
algorithm - the algorithm
valueAsHex - the hex value
Returns:
the hash


Copyright © 2009 cedarsoft GmbH. All Rights Reserved.