use only meaningful bytes to calculate stub hash

GitOrigin-RevId: 008bb90612d555bcacbe9d5f164dd26be29f23c0
This commit is contained in:
Dmitry Batkovich
2019-06-16 07:57:05 +03:00
committed by intellij-monorepo-bot
parent af8c11be8a
commit cf31735622
@@ -120,7 +120,7 @@ public class SerializedStubTree {
}
}
myIndexedStubs = new IndexedStubs(calculateHash(myBytes), (Map)map);
myIndexedStubs = new IndexedStubs(calculateHash(myBytes, myLength), (Map)map);
}
@NotNull
@@ -180,9 +180,9 @@ public class SerializedStubTree {
}
@NotNull
private static byte[] calculateHash(@NotNull byte[] content) {
private static byte[] calculateHash(@NotNull byte[] content, int length) {
MessageDigest digest = HASHER.getValue();
digest.update(content);
digest.update(content, 0, length);
return digest.digest();
}