diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2020-02-02 13:49:41 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-02 16:49:41 -0500 |
commit | e8df66c12cbb3e51f8776aa91e6db41bbfdcae5e (patch) | |
tree | 8d2de7b60c671c4e2a927277681c71853f90dd74 /std/encoding/README.md | |
parent | 77f4df40f3d5a9456118dc0c296ee2a465b6033a (diff) |
std/encoding: add base32 support (#3855)
Diffstat (limited to 'std/encoding/README.md')
-rw-r--r-- | std/encoding/README.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/std/encoding/README.md b/std/encoding/README.md index 6f0704b04..d96075746 100644 --- a/std/encoding/README.md +++ b/std/encoding/README.md @@ -219,3 +219,26 @@ Serializes `object` as a YAML document. See [`./yaml/example`](./yaml/example) folder and [js-yaml] repository. [js-yaml]: https://github.com/nodeca/js-yaml + +## base32 + +[RFC4648 base32](https://tools.ietf.org/html/rfc4648#section-6) encoder/decoder +for Deno + +### Basic usage + +`encode` encodes a `Uint8Array` to RFC4648 base32 representation, and `decode` +decodes the given RFC4648 base32 representation to a `Uint8Array`. + +```ts +import { encode, decode } from "https://deno.land/std/encoding/base32.ts"; + +const b32Repr = "RC2E6GA="; + +const binaryData = decode(b32Repr); +console.log(binaryData); +// => Uint8Array [ 136, 180, 79, 24 ] + +console.log(encode(binaryData)); +// => RC2E6GA= +``` |