Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

base64url-arraybuffer

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base64url-arraybuffer

Encode and Decode Base64URLs into ArrayBuffers

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
decreased by-16.67%
Maintainers
1
Weekly downloads
 
Created
Source

Base64URL-ArrayBuffer

npm version

Converts between Base64URL and ArrayBuffer.

Available functions

// Encode an ArrayBuffer to a base64url string.
encode(buffer:ArrayBuffer) : string

// Decode a base64url string to an ArrayBuffer.
decode(base64url: string) : ArrayBuffer

// Utilities
// Convert a string to an ArrayBuffer.
arrayBufferToString(buffer: ArrayBuffer) : string

// Convert an ArrayBuffer to a string.
stringToArrayBuffer(str: string) : ArrayBuffer

Getting Started

This library can be used on Node.js and Browser

Node.js/AMD

npm install base64url-arraybuffer
ESM
import { encode, decode } from "base64url-arraybuffer";

const base64url = encode(arrayBuffer);

const arrayBuffer = decode(base64url);
CommonJS
const base64url = require("base64url-arraybuffer");

const base64urlString = base64url.encode(arrayBuffer);

const arrayBuffer = base64url.decode(base64urlString);

Browser

<script src="https://unpkg.com/base64url-arraybuffer"></script>

<script>
  const base64url = base64url.encode(arrayBuffer);

  const arrayBuffer = base64url.decode(base64url);
</script>

License

MIT

Crafted by

Deepu K Sasidharan [ website | Linkedin | GitHub | Twitter | Mastodon ]

Keywords

FAQs

Package last updated on 05 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc