You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
11 months ago | |
---|---|---|
README.md | 11 months ago | |
main.slo | 11 months ago | |
module.json | 11 months ago |
README.md
base64
base64 encoding and decoding for the slope programming language.
Usage
The module has two procedures: encode
and decode
. Usage information has been set up for the module so the following can be used at the repl:
(load-mod base64)
(usage base64::)
(usage base64::encode)
(usage base64::decode)
Encode
; (base64::encode [input: string|byte-list] [[url-safe?: bool]]) => string
(base64::encode "Hello, world!") ; => "SGVsbG8sIHdvcmxkIQ=="
If a truthy value is given for the second argument, url-safe?
, the url/filepath safe variant of base64 will be used.
Decode
; (base64::decode [input: string|byte-list]) => string
(base64::decode "SGVsbG8sIHdvcmxkIQ==") ; => "Hello, world!"
decode
will automatically detect the usage of the url/filepath variant of base64 and decode either that or the standard version automatically.