Class Hash
java.lang.Object
io.getlime.security.powerauth.crypto.lib.util.Hash
Simple utility class that provides the basic hash methods.
Supported methods:
- SHA256
- Author:
- Petr Dvorak, petr@wultra.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]sha256(byte[] originalBytes) Compute SHA256 hash of provided bytes.static byte[]Compute SHA256 hash of provided string, that was transferred to data using UTF-8 charset.static byte[]Compute SHA256 hash of provided string, that was transferred to data using provided charset.
-
Constructor Details
-
Hash
public Hash()
-
-
Method Details
-
sha256
public static byte[] sha256(byte[] originalBytes) Compute SHA256 hash of provided bytes.- Parameters:
originalBytes- Original bytes.- Returns:
- SHA256 hash of provided original bytes.
-
sha256
Compute SHA256 hash of provided string, that was transferred to data using UTF-8 charset.- Parameters:
string- String to be hashed.- Returns:
- SHA256 hash of provided string.
-
sha256
Compute SHA256 hash of provided string, that was transferred to data using provided charset.- Parameters:
string- Original string to be hashed.charset- Charset to be used to convert string to bytes.- Returns:
- SHA256 hash of provided string.
-