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

@stablelib/base64

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stablelib/base64

Base64 encoding and decoding

  • 0.2.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
237K
increased by15.71%
Maintainers
1
Weekly downloads
 
Created

What is @stablelib/base64?

@stablelib/base64 is a JavaScript library for encoding and decoding data in Base64 format. It is part of the StableLib collection of cryptographic and encoding libraries, which are designed to be secure, fast, and easy to use.

What are @stablelib/base64's main functionalities?

Base64 Encoding

This feature allows you to encode binary data into a Base64 string. The code sample demonstrates encoding the ASCII representation of 'Hello' into Base64.

const { encode } = require('@stablelib/base64');
const data = new Uint8Array([72, 101, 108, 108, 111]); // 'Hello' in ASCII
const encoded = encode(data);
console.log(encoded); // Outputs: 'SGVsbG8='

Base64 Decoding

This feature allows you to decode a Base64 string back into binary data. The code sample demonstrates decoding the Base64 string 'SGVsbG8=' back into its original binary form.

const { decode } = require('@stablelib/base64');
const base64String = 'SGVsbG8=';
const decoded = decode(base64String);
console.log(decoded); // Outputs: Uint8Array(5) [ 72, 101, 108, 108, 111 ]

Other packages similar to @stablelib/base64

FAQs

Package last updated on 29 Apr 2017

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