Added stringToBytes convertion
This commit is contained in:
parent
04551f1528
commit
a8dcd6e9fd
@ -1,5 +1,7 @@
|
||||
package Main;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
public class Utils {
|
||||
static String bytesToHex(byte[] hash) {
|
||||
StringBuilder hexString = new StringBuilder(2 * hash.length);
|
||||
@ -12,4 +14,8 @@ public class Utils {
|
||||
}
|
||||
return hexString.toString();
|
||||
}
|
||||
|
||||
static byte[] stringToBytes(String hexString) {
|
||||
return new BigInteger(hexString, 16).toByteArray();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user