(String input)
| 34 | |
| 35 | // 输入字符串返回哈希值 |
| 36 | public String hashValue(String input) { |
| 37 | byte[] hashInBytes = md.digest(input.getBytes(StandardCharsets.UTF_8)); |
| 38 | BigInteger bigInt = new BigInteger(1, hashInBytes); |
| 39 | String hashText = bigInt.toString(16); |
| 40 | return hashText; |
| 41 | } |
| 42 | |
| 43 | } |
| 44 |