2024-04-20 15:59:14 +02:00
|
|
|
(local { : hash : base64url } (require :init))
|
|
|
|
(import-macros { : expect= } :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")
|