2023-09-10 13:14:39 +02:00
|
|
|
(local { : hash : base64url } (require :anoia))
|
2024-04-20 15:04:32 +02:00
|
|
|
(import-macros { : expect= } :anoia.assert)
|
2023-09-10 13:14:39 +02:00
|
|
|
|
2024-04-20 15:04:32 +02:00
|
|
|
(expect= (hash "") 5381)
|
2023-09-10 13:14:39 +02:00
|
|
|
|
|
|
|
;; these examples from https://theartincode.stanis.me/008-djb2/
|
2024-04-20 15:04:32 +02:00
|
|
|
(expect= (hash "Hello") 210676686969)
|
|
|
|
(expect= (hash "Hello!") 6952330670010)
|
2023-09-10 13:14:39 +02:00
|
|
|
|
2024-04-20 15:04:32 +02:00
|
|
|
(expect= (base64url "hello world") "aGVsbG8gd29ybGQ")
|