MCPcopy Create free account
hub / github.com/VolmitSoftware/Adapt / bytesToHex

Method bytesToHex

src/main/java/com/volmit/adapt/util/IO.java:125–134  ·  view source on GitHub ↗
(byte[] bytes)

Source from the content-addressed store, hash-verified

123 }
124
125 public static String bytesToHex(byte[] bytes) {
126 char[] hexChars = new char[bytes.length * 2];
127 for (int j = 0; j < bytes.length; j++) {
128 int v = bytes[j] & 0xFF;
129 hexChars[j * 2] = hexArray[v >>> 4];
130 hexChars[j * 2 + 1] = hexArray[v & 0x0F];
131 }
132
133 return new String(hexChars).toUpperCase();
134 }
135
136 /**
137 * Transfers the length of the buffer amount of data from the input stream to

Callers 1

hashMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected