Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/djwt/deps.ts>base64url

Create and verify JSON Web Tokens (JWT) with Deno or the browser.
Very Popular
Go to Latest
namespace base64url
import { base64url } from "https://deno.land/x/djwt@v2.9/deps.ts";

encode and decode for base64 URL safe encoding.

This module is browser compatible.

Examples

Example 1

import {
  decode,
  encode,
} from "https://deno.land/std@0.224.0/encoding/base64url.ts";

const binary = new TextEncoder().encode("foobar");
const encoded = encode(binary);
console.log(encoded);
// => "Zm9vYmFy"

console.log(decode(encoded));
// => Uint8Array(6) [ 102, 111, 111, 98, 97, 114 ]

Functions

Converts given base64url encoded data back to original

Encodes a given ArrayBuffer or string into a base64url representation