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

base64-js

Package Overview
Dependencies
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base64-js

Base64 encoding/decoding in pure JS

  • 1.5.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
35M
decreased by-19.83%
Maintainers
2
Weekly downloads
 
Created

What is base64-js?

The base64-js npm package is a utility for encoding and decoding data to and from base64, a binary-to-text encoding scheme that represents binary data in an ASCII string format. It is commonly used to encode data in web applications.

What are base64-js's main functionalities?

Encoding a byte array to a base64 string

This feature allows you to convert a byte array (Uint8Array) into a base64 encoded string.

"use strict";\nconst base64js = require('base64-js');\nconst bytes = new Uint8Array([72, 101, 108, 108, 111]);\nconst base64String = base64js.fromByteArray(bytes);\nconsole.log(base64String); // Outputs: 'SGVsbG8='

Decoding a base64 string to a byte array

This feature allows you to convert a base64 encoded string back into a byte array (Uint8Array).

"use strict";\nconst base64js = require('base64-js');\nconst base64String = 'SGVsbG8=';\nconst bytes = base64js.toByteArray(base64String);\nconsole.log(bytes); // Outputs: Uint8Array [72, 101, 108, 108, 111]

Other packages similar to base64-js

Keywords

FAQs

Package last updated on 11 Nov 2020

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