MCPcopy Index your code
hub / github.com/SeanDragon/protools / toHex

Method toHex

security/src/main/java/pro/tools/security/ToolPBE2.java:119–128  ·  view source on GitHub ↗

二进制字符串转十六进制字符串 @param array the byte array to ToolJson @return a length 2 character string encoding the byte array

(byte[] array)

Source from the content-addressed store, hash-verified

117 * @return a length*2 character string encoding the byte array
118 */
119 private static String toHex(byte[] array) {
120 BigInteger bi = new BigInteger(1, array);
121 String hex = bi.toString(16);
122 int paddingLength = (array.length * 2) - hex.length();
123 if (paddingLength > 0) {
124 return String.format("%0" + paddingLength + "d", 0) + hex;
125 } else {
126 return hex;
127 }
128 }
129}

Callers 2

getEncryptedPasswordMethod · 0.95
generateSaltMethod · 0.95

Calls 3

lengthMethod · 0.80
toStringMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected