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

awesome-urlsafe-base64

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

awesome-urlsafe-base64

A very simple base64 encoder that produces URL safe base64 encodings.

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
increased by1400%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status codecov

awesome-urlsafe-base64


This is a simple utility that will do base64 encoding and then do some replacing of the URL unfriendly characters that are potentially added during the base64 encoding.

This utility is somewhat compatible with the existing urlsafe-base64 NPM module.

Eventually this library will support Variants of the Base64 algorithm.

.encodeBuffer(buffer) :: string

Encodes a buffer as an URL Safe Base64-like string. This function encodes to the RFC 4648 Spec where '+' is encoded as '-' the '/' is encoded as '_' and the padding character '=' is encoded as '.'.

var AwesomeBase64 = require('awesome-urlsafe-base64');
var buffer = new Buffer('http://www.encode.me/please/kthxbye');
var encodedString = AwesomeBase64.encode(buffer);

.decodeBuffer(string) :: buffer

Decodes a previously encoded string.

var AwesomeBase64 = require('awesome-urlsafe-base64');
var toDecode = 'VWJlciBTdHJpbmcgdG8gRW5jb2Rl';
var buffer = AwesomeBase64.decode(toDecode);

.encodeString(string) :: string

Encodes a string.

var AwesomeBase64 = require('awesome-urlsafe-base64');
var toEncode = 'http://www.encode.me/please/kthxbye';
var encodedString = AwesomeBase64.encode(buffer);

.decodeString(string) :: string

Decodes a string.

var AwesomeBase64 = require('awesome-urlsafe-base64');
var toDecode = 'VWJlciBTdHJpbmcgdG8gRW5jb2Rl';
var decodedString = AwesomeBase64.encode(buffer);

.encode(buffer) :: string

Alias for .encodeBuffer

.decode(string) :: buffer

Alias for .decodeBuffer

Keywords

FAQs

Package last updated on 08 Sep 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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc