MCPcopy Create free account
hub / github.com/0x727/DropLabTools / bytesToHex

Method bytesToHex

src/main/java/com/droplab/Utils/CommonUtils.java:70–80  ·  view source on GitHub ↗

字节数组转16进制 @param bytes @return

(byte[] bytes)

Source from the content-addressed store, hash-verified

68 * @return
69 */
70 public static String bytesToHex(byte[] bytes) { //字节转16进制
71 StringBuffer stringBuffer = new StringBuffer();
72 for (int i = 0; i < bytes.length; i++) {
73 String s = Integer.toHexString(bytes[i] & 0xFF);
74 if (s.length() < 2) {
75 s = "0" + s;
76 }
77 stringBuffer.append(s.toLowerCase());
78 }
79 return stringBuffer.toString();
80 }
81
82 /**
83 * unicode 转字符串

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected