Use last 16 chars for checksum (#1064)

* Fix deprecation warning in Gradle 8.7 (#1056)

* use last 16 chars for checksum

* hash the path

Co-authored-by: Flemmli97 <Flemmli97@users.noreply.github.com>
This commit is contained in:
Flemmli97
2024-03-10 14:39:22 +01:00
committed by GitHub
parent 2e74a84d37
commit 21b7dd9b99

View File

@@ -96,6 +96,7 @@ public class Checksum {
public static String projectHash(Project project) {
String str = project.getProjectDir().getAbsolutePath() + ":" + project.getPath();
return toHex(str.getBytes(StandardCharsets.UTF_8)).substring(0, 16);
String hex = sha1Hex(str.getBytes(StandardCharsets.UTF_8));
return hex.substring(hex.length() - 16);
}
}