MCPcopy Index your code
hub / github.com/f0ng/autoDecoder / byteToHex

Method byteToHex

src/com/autoDecoder/util/Util.java:593–610  ·  view source on GitHub ↗

字节数组转换为十六进制字符串 @param b byte[] 需要转换的字节数组 @return String 十六进制字符串

(byte b[])

Source from the content-addressed store, hash-verified

591 * @return String 十六进制字符串
592 */
593 public static String byteToHex(byte b[]) {
594 if (b == null) {
595 throw new IllegalArgumentException(
596 "Argument b ( byte array ) is null! ");
597 }
598 String hs = "";
599 String stmp = "";
600 for (int n = 0; n < b.length; n++) {
601 stmp = Integer.toHexString(b[n] & 0xff);
602 if (stmp.length() == 1) {
603 hs = hs + "0" + stmp;
604 } else {
605 hs = hs + stmp;
606 }
607 }
608 return hs.toLowerCase();
609 //return hs.toUpperCase();
610 }
611
612 public static byte[] subByte(byte[] input, int startIndex, int length) {
613 byte[] bt = new byte[length];

Callers 6

encryptData_ECBMethod · 0.95
encryptData_CBCMethod · 0.95
mainMethod · 0.95
paddingMethod · 0.95
decryptKeyivmodeMethod · 0.95
encryptKeyivmodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected