MCPcopy Index your code
hub / github.com/ccxt/ccxt / hexToBytes

Method hexToBytes

java/lib/src/main/java/io/github/ccxt/base/Crypto.java:544–553  ·  view source on GitHub ↗
(String hex)

Source from the content-addressed store, hash-verified

542 }
543
544 private static byte[] hexToBytes(String hex) {
545 // return Hex.decode(hex.replaceFirst("^0x", ""));
546 int len = hex.length();
547 byte[] data = new byte[len / 2];
548 for (int i = 0; i < len; i += 2) {
549 data[i / 2] = (byte) ((Character.digit(hex.charAt(i), 16) << 4)
550 + Character.digit(hex.charAt(i+1), 16));
551 }
552 return data;
553 }
554
555 public static String ByteArrayToString(byte[] ba) {
556 return binaryToHex(ba).toUpperCase(Locale.ROOT);

Callers 1

EcdsaMethod · 0.95

Calls 1

lengthMethod · 0.45

Tested by

no test coverage detected