shorter hashes - just first seven characters.. like in git
authorJim Procter <jprocter@dundee.ac.uk>
Fri, 12 Jul 2024 16:58:43 +0000 (17:58 +0100)
committerJim Procter <jprocter@dundee.ac.uk>
Fri, 12 Jul 2024 17:05:38 +0000 (18:05 +0100)
getdown/lib/getdown-core.jar
getdown/lib/getdown-launcher-local.jar
getdown/lib/getdown-launcher.jar
getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/EnvConfig.java
j11lib/getdown-core.jar
j8lib/getdown-core.jar

index 678bc51..7322e08 100644 (file)
Binary files a/getdown/lib/getdown-core.jar and b/getdown/lib/getdown-core.jar differ
index 83cd51d..c167e33 100644 (file)
Binary files a/getdown/lib/getdown-launcher-local.jar and b/getdown/lib/getdown-launcher-local.jar differ
index f35c5bc..476193c 100644 (file)
Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ
index 7eb32df..9dead81 100644 (file)
@@ -349,13 +349,17 @@ public final class EnvConfig {
         this.appArgs = appArgs;
     }
     
+    /**
+     * compute a hash for the given path string using the getdown digest
+     * @param install_app_dir
+     * @return 8-character hex hash
+     */
     public static final String getFullPathToDirectoryHash(String install_app_dir)
     {
-      //sha1 is good enough we hope - paths are short
-      MessageDigest md = Digest.getMessageDigest(1);
+      MessageDigest md = Digest.getMessageDigest(Digest.VERSION);
       byte[] contents = install_app_dir.getBytes(UTF_8);
       String hash = StringUtil.hexlate(md.digest(contents));
-      return hash;
+      return hash.substring(0,8);
     }
     
     protected static final String getUserAppdir() {
index 678bc51..7322e08 100644 (file)
Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ
index 678bc51..7322e08 100644 (file)
Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ