java.lang.Object
org.tquadrat.foundation.util.internal.HashImpl
- All Implemented Interfaces:
Serializable,Cloneable,Hash
@ClassVersion(sourceVersion="$Id: HashImpl.java 1080 2024-01-03 11:05:21Z tquadrat $")
@API(status=INTERNAL,
since="0.1.1")
public final class HashImpl
extends Object
implements Hash
The implementation for the interface
Hash.- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: HashImpl.java 1080 2024-01-03 11:05:21Z tquadrat $
- Since:
- 0.1.1
- See Also:
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.util.internal.HashImpl"
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal byte[]bytes()Returns the hash as an array of bytes.final HashImplclone()Creates and returns a copy of this object.static final HashImplcreate(byte[] data, MessageDigest algorithm) Creates the hash for the given byte array, using the given algorithm.static final HashImplCreates the hash for the given byte array, using the given algorithm.static Hashcreate(Path data, MessageDigest algorithm) Creates the hash for the given file, using the given algorithm.static HashCreates the hash for the given file, using the given algorithm.final booleanstatic final HashImplfrom(CharSequence hashValue) Creates an instance ofHashfrom the given String.final inthashCode()final StringtoString()
-
Field Details
-
m_HashValue
The hash value.
-
-
Constructor Details
-
HashImpl
Creates a new instance ofHashImpl.- Parameters:
hashValue- The hash value.
-
-
Method Details
-
bytes
Returns the hash as an array of bytes. -
clone
Creates and returns a copy of this object. -
create
Creates the hash for the given byte array, using the given algorithm.- Parameters:
data- The input data.algorithm- The algorithm- Returns:
- A new instance of
HashImpl.
-
create
Creates the hash for the given file, using the given algorithm.- Parameters:
data- The input data.algorithm- The algorithm- Returns:
- A new instance of
HashImpl. - Throws:
IOException- Problems to process the file.
-
create
Creates the hash for the given byte array, using the given algorithm.- Parameters:
data- The input data.algorithm- The algorithm- Returns:
- A new instance of
HashImpl.
-
create
Creates the hash for the given file, using the given algorithm.- Parameters:
data- The input data.algorithm- The algorithm- Returns:
- A new instance of
HashImpl. - Throws:
IOException- Problems to process the file.
-
equals
-
from
Creates an instance ofHashfrom the given String.- Parameters:
hashValue- The hash value.- Returns:
- A new instance of
HashImpl.
-
hashCode
-
toString
-
