Socket
Socket
Sign inDemoInstall

base64-url

Package Overview
Dependencies
0
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 2.1.0

19

index.js
'use strict'
const base64url = module.exports
module.exports = {
unescape,
escape,
encode,
decode
}
base64url.unescape = function unescape (str) {
function unescape (str) {
return (str + '==='.slice((str.length + 3) % 4))

@@ -11,3 +16,3 @@ .replace(/-/g, '+')

base64url.escape = function escape (str) {
function escape (str) {
return str.replace(/\+/g, '-')

@@ -18,8 +23,8 @@ .replace(/\//g, '_')

base64url.encode = function encode (str, encoding) {
return this.escape(Buffer.from(str, encoding || 'utf8').toString('base64'))
function encode (str, encoding) {
return escape(Buffer.from(str, encoding || 'utf8').toString('base64'))
}
base64url.decode = function decode (str, encoding) {
return Buffer.from(this.unescape(str), 'base64').toString(encoding || 'utf8')
function decode (str, encoding) {
return Buffer.from(unescape(str), 'base64').toString(encoding || 'utf8')
}
{
"name": "base64-url",
"version": "2.0.1",
"version": "2.1.0",
"description": "Base64 encode, decode, escape and unescape for URL applications",

@@ -32,4 +32,4 @@ "main": "index.js",

"devDependencies": {
"coveralls": "^2.13.1",
"nyc": "^11.1.0",
"coveralls": "^3.0.0",
"nyc": "^11.4.1",
"pre-commit": "^1.2.2",

@@ -36,0 +36,0 @@ "standard": "^10.0.3",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc