MCPcopy Index your code
hub / github.com/FabricMC/Matcher / hash

Method hash

src/main/java/matcher/type/InputFile.java:130–146  ·  view source on GitHub ↗
(Path path)

Source from the content-addressed store, hash-verified

128 }
129
130 public byte[] hash(Path path) throws IOException {
131 TlData tlData = tlDatas.get();
132
133 MessageDigest digest = tlData.digests.get(this);
134 ByteBuffer buffer = tlData.buffer;
135 buffer.clear();
136
137 try (SeekableByteChannel channel = Files.newByteChannel(path)) {
138 while (channel.read(buffer) != -1) {
139 buffer.flip();
140 digest.update(buffer);
141 buffer.clear();
142 }
143 }
144
145 return digest.digest();
146 }
147
148 private static class TlData {
149 TlData() {

Callers 2

InputFileMethod · 0.80
equalsMethod · 0.80

Calls 4

readMethod · 0.80
getMethod · 0.45
clearMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected