anoia: add simple hash function and base64 encoder

This commit is contained in:
Daniel Barlow
2023-09-10 12:14:39 +01:00
parent 870da62a1e
commit 22275f311c
2 changed files with 53 additions and 1 deletions

9
pkgs/anoia/test.fnl Normal file
View File

@@ -0,0 +1,9 @@
(local { : hash : base64url } (require :anoia))
(assert (= (hash "") 5381))
;; these examples from https://theartincode.stanis.me/008-djb2/
(assert (= (hash "Hello") 210676686969))
(assert (= (hash "Hello!") 6952330670010))
(assert (= (base64url "hello world") "aGVsbG8gd29ybGQ"))