Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Brewster chronakazi

View GitHub Profile
@chronakazi
chronakazi / merkle.tree.clj
Created January 13, 2022 20:53 — forked from maxcountryman/merkle.tree.clj
A Clojure Merkle tree utilizing SHA-256.
View merkle.tree.clj
(ns merkle.tree
(:import [java.security MessageDigest]))
(defn sha-256-digest [bs]
(.digest
(doto (MessageDigest/getInstance "SHA-256")
(.update bs))))
(def double-sha-256 (comp sha-256-digest sha-256-digest))