From: Jim Procter Date: Fri, 12 Jul 2024 16:58:43 +0000 (+0100) Subject: shorter hashes - just first seven characters.. like in git X-Git-Tag: Release_2_11_4_0~20^2~15 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a7abe11a9b782d50287bd7e7249cb58a5753445d;p=jalview.git shorter hashes - just first seven characters.. like in git --- diff --git a/getdown/lib/getdown-core.jar b/getdown/lib/getdown-core.jar index 678bc51..7322e08 100644 Binary files a/getdown/lib/getdown-core.jar and b/getdown/lib/getdown-core.jar differ diff --git a/getdown/lib/getdown-launcher-local.jar b/getdown/lib/getdown-launcher-local.jar index 83cd51d..c167e33 100644 Binary files a/getdown/lib/getdown-launcher-local.jar and b/getdown/lib/getdown-launcher-local.jar differ diff --git a/getdown/lib/getdown-launcher.jar b/getdown/lib/getdown-launcher.jar index f35c5bc..476193c 100644 Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ diff --git a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/EnvConfig.java b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/EnvConfig.java index 7eb32df..9dead81 100644 --- a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/EnvConfig.java +++ b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/EnvConfig.java @@ -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() { diff --git a/j11lib/getdown-core.jar b/j11lib/getdown-core.jar index 678bc51..7322e08 100644 Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ diff --git a/j8lib/getdown-core.jar b/j8lib/getdown-core.jar index 678bc51..7322e08 100644 Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ