MCPcopy Create free account
hub / github.com/algorithmzuo/algorithm-journey / hashValue

Method hashValue

src/class106/HashFunction.java:36–41  ·  view source on GitHub ↗
(String input)

Source from the content-addressed store, hash-verified

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

Callers 1

mainMethod · 0.95

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected