diff options
| author | 2022-10-09 16:43:27 -0500 | |
|---|---|---|
| committer | 2022-10-09 16:43:27 -0500 | |
| commit | d0abee5bc66f2167b736f2c9cf33ffe3c4d1487e (patch) | |
| tree | 3ea5f96a30179f266c767369f9d66fdfa013fdee /doc | |
| parent | Merge pull request #87 from pepe/fix-mdz-build (diff) | |
| parent | added base64 encoder/decoder (diff) | |
Merge pull request #85 from tionis/master
added base64 encoder and decoder
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/misc.mdz | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/misc.mdz b/doc/misc.mdz index 39ccc0a..a497e9c 100644 --- a/doc/misc.mdz +++ b/doc/misc.mdz @@ -384,3 +384,19 @@ Returns an array of hexs from the string with pgp words. (misc/pgp/words->hexs "absurd-scavenger accrue_universe upshot.village") # => @["01" "D1" "02" "EE" "F4" "F6"] ``` + +## base64/encode +Converts a string of any format (UTF-8, binary, ..) to base64 encoding. +@codeblock[janet]``` +(misc/base64/encode "this is a test") +# => "dGhpcyBpcyBhIHRlc3Q=" +``` + + +## base64/decode +Converts a base64 encoded string to its binary representation of any format (UTF-8, binary, ..). +@codeblock[janet]``` +(misc/base64/decode "dGhpcyBpcyBhIHRlc3Q=") +# => "this is a test" +``` + |
