(defn content-sha
([^String s]
(content-sha s nil))
([^String s ^Long n]
(let [digest (MessageDigest/getInstance "SHA-1")
_ (.reset digest)
_ (.update digest (.getBytes s "utf8"))
sha (DatatypeConverter/printHexBinary (.digest digest))]
(if-not (nil? n)
(apply str (take n sha))
sha))))