Package com.oceanprotocol.squid.helpers
Class CryptoHelper
- java.lang.Object
-
- com.oceanprotocol.squid.helpers.CryptoHelper
-
public abstract class CryptoHelper extends Object
Helper abstract class with crypto utility methods
-
-
Field Summary
Fields Modifier and Type Field Description private static char[]
DIGITS
The Constant DIGITS.private static BigInteger
MASK_256
-
Constructor Summary
Constructors Constructor Description CryptoHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getHex(byte[] data)
Gets the hex.static String
sha3(String input)
Given an input string return the result of sha3static byte[]
soliditySha3(Object... data)
Given N objects, return the SHA3 of those objectsstatic byte[]
toBytes(Object obj)
Given an object (byte[], BigInteger, Address, Uint or Number) gets the byte[] with the proper length
-
-
-
Field Detail
-
DIGITS
private static final char[] DIGITS
The Constant DIGITS.
-
MASK_256
private static final BigInteger MASK_256
-
-
Method Detail
-
sha3
public static String sha3(String input)
Given an input string return the result of sha3- Parameters:
input
- string- Returns:
- hashed message
-
soliditySha3
public static byte[] soliditySha3(Object... data)
Given N objects, return the SHA3 of those objects- Parameters:
data
- objects- Returns:
- sha3
-
getHex
public static String getHex(byte[] data)
Gets the hex.- Parameters:
data
- the data- Returns:
- the hex
-
toBytes
public static byte[] toBytes(Object obj)
Given an object (byte[], BigInteger, Address, Uint or Number) gets the byte[] with the proper length- Parameters:
obj
- the object- Returns:
- byte[]
-
-