Janet-botan is a Janet bindings to Botan.
https://github.com/tttuuu888/janet-botan
[sudo] jpm install https://github.com/tttuuu888/janet-botan.git
Janet-botan provides flexible ways to perform cryptographic operations. Below are examples demonstrating three different styles of using Janet-botan for SHA-256 hashing.
This method uses direct function calls to perform hashing operations.
(let [hash (hash/new "SHA-256")]
(hash/update hash "1234")
(hash/update hash "5678")
(print (hash/final hash)))
This approach uses Janet's method syntax to call functions on the hash object.
(let [hash (hash/new "SHA-256")]
(:update hash "1234")
(:update hash "5678")
(print (:final hash)))
This example demonstrates the use of Janet's threading macro (`->`) for a more functional style.
(let [hash (hash/new "SHA-256")]
(-> hash
(:update "1234")
(:update "5678")
(:final)
(print)))