You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

base64-url

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base64-url

Base64 encode, decode, escape and unescape for URL applications


Version published
Weekly downloads
538K
decreased by-2.46%
Maintainers
1
Install size
4.08 kB
Created
Weekly downloads
 

Package description

What is base64-url?

The base64-url npm package provides utilities for encoding and decoding data in base64 format, specifically tailored for URL-safe operations. It ensures that the encoded data is safe to use in URLs by replacing characters that are not URL-safe.

What are base64-url's main functionalities?

Encode to Base64 URL

This feature allows you to encode a string into a URL-safe base64 format. The encoded string can be safely used in URLs without any issues.

const base64url = require('base64-url');
const encoded = base64url.encode('Hello World!');
console.log(encoded); // Outputs: 'SGVsbG8gV29ybGQh'

Decode from Base64 URL

This feature allows you to decode a URL-safe base64 encoded string back to its original form.

const base64url = require('base64-url');
const decoded = base64url.decode('SGVsbG8gV29ybGQh');
console.log(decoded); // Outputs: 'Hello World!'

Escape Base64

This feature escapes a base64 encoded string to make it URL-safe by replacing characters like '+' and '/' with '-' and '_'.

const base64url = require('base64-url');
const escaped = base64url.escape('SGVsbG8gV29ybGQh');
console.log(escaped); // Outputs: 'SGVsbG8gV29ybGQh'

Unescape Base64

This feature unescapes a URL-safe base64 encoded string back to its original base64 format.

const base64url = require('base64-url');
const unescaped = base64url.unescape('SGVsbG8gV29ybGQh');
console.log(unescaped); // Outputs: 'SGVsbG8gV29ybGQh'

Other packages similar to base64-url

Readme

Source

base64-url

Base64 encode, decode, escape and unescape for URL applications.

Build Status

API

var base64url = require('base64-url');

base64url.encode('Node.js is awesome.');
// returns Tm9kZS5qcyBpcyBhd2Vzb21lLg

base64url.decode('Tm9kZS5qcyBpcyBhd2Vzb21lLg');
// returns Node.js is awesome.

base64url.escape('This+is/goingto+escape==');
// returns This-is_goingto-escape

base64url.unescape('This-is_goingto-escape');
// returns This+is/goingto+escape==

Development

this project has been set up with a precommit that forces you to follow a code style, no jshint issues and 100% of code coverage before commit

to run test

npm test

to run lint

npm run lint

to run code style

npm run style

to check code coverage

npm run coverage:check

Keywords

FAQs

Package last updated on 28 Oct 2016

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc