liminix/pkgs/anoia/test.fnl

11 lines
309 B
Text
Raw Permalink Normal View History

(local { : hash : base64url } (require :init))
(import-macros { : expect= } :assert)
(expect= (hash "") 5381)
;; these examples from https://theartincode.stanis.me/008-djb2/
(expect= (hash "Hello") 210676686969)
(expect= (hash "Hello!") 6952330670010)
(expect= (base64url "hello world") "aGVsbG8gd29ybGQ")