(byte[] hash)
| 513 | } |
| 514 | |
| 515 | private static String bytesToHex(byte[] hash) { |
| 516 | StringBuilder hexString = new StringBuilder(2 * hash.length); |
| 517 | for (int i = 0; i < hash.length; i++) { |
| 518 | String hex = Integer.toHexString(0xff & hash[i]); |
| 519 | if (hex.length() == 1) { |
| 520 | hexString.append('0'); |
| 521 | } |
| 522 | hexString.append(hex); |
| 523 | } |
| 524 | return hexString.toString(); |
| 525 | } |
| 526 | |
| 527 | } |