We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e6bb9eb commit ea9e4faCopy full SHA for ea9e4fa
1 file changed
src/net/lewisship/cli_tools/cache.cljc
@@ -9,6 +9,7 @@
9
[clj-commons.ansi :refer [perr]]
10
#?(:bb [babashka.classpath :as cp]))
11
(:import (java.io File)
12
+ (java.util HexFormat)
13
(java.nio ByteBuffer)
14
(java.security MessageDigest)))
15
@@ -58,10 +59,10 @@
58
59
;; Adding or removing a file (even if no other files are touched) will change the digest.
60
(update-digest-recursively digest f))))
61
-(defn- hex-string [^bytes input]
62
- (let [sb (StringBuilder.)]
63
- (run! #(.append sb (format "%X" %)) input)
64
- (str sb)))
+(defn- hex-string
+ [^bytes input]
+ (-> (HexFormat/of)
65
+ (.formatHex input)))
66
67
(defn classpath-digest
68
"Passed the tool options, return a hex string of the SHA-1 digest of the files from the classpath and
0 commit comments