bugzerotk
10/28/2016 - 5:16 AM

バイナリ -> hex 文字列

バイナリ -> hex 文字列

	public static void print(byte[] hash) {
		StringBuilder hashStrBuf = new StringBuilder();
		for (byte hashByte : hash) {
			final String hashHexStr = Integer.toHexString(hashByte & 0xff);
			if (hashHexStr.length() == 1) {
				hashStrBuf.append("0");
			}
			hashStrBuf.append(hashHexStr);
		}
		
		System.out.println(hashStrBuf.toString());
	}