Last active
April 15, 2021 16:06
-
-
Save rotaliator/5d4c19e2cc2fffece2649ce3b3c348b1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn crc32 | |
"Calculates CRC32 checksum of string s" | |
[^String s] | |
(let [bytes (.getBytes s)] | |
(. (doto (new java.util.zip.CRC32) | |
(.update bytes 0 (alength bytes))) | |
getValue))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment