MCPcopy Create free account
hub / github.com/BombusMod/BombusMod / hexByteToString

Method hexByteToString

src/main/java/util/StringUtils.java:175–189  ·  view source on GitHub ↗
(byte b)

Source from the content-addressed store, hash-verified

173 }
174
175 public static String hexByteToString(byte b){
176 StringBuffer out=new StringBuffer();
177 char c = (char) ((b >> 4) & 0xf);
178 if (c > 9) c = (char) ((c - 10) + 'a');
179 else c = (char) (c + '0');
180 out.append(c);
181 c = (char) (b & 0xf);
182 if (c > 9)
183 c = (char)((c-10) + 'a');
184 else
185 c = (char)(c + '0');
186 out.append(c);
187
188 return out.toString();
189 }
190 public static String getDigestHex(byte[] digestBits) {
191 StringBuffer out = new StringBuffer();
192 for (int i = 0; i < digestBits.length; i++) {

Callers 2

urlPrepMethod · 0.95
getDigestHexMethod · 0.95

Calls 2

appendMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected