Socket
Socket
Sign inDemoInstall

base64url

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base64url - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

10

dist/base64url.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const pad_string_1 = require("./pad-string");
function encode(input, encoding = "utf8") {
var pad_string_1 = require("./pad-string");
function encode(input, encoding) {
if (encoding === void 0) { encoding = "utf8"; }
if (Buffer.isBuffer(input)) {

@@ -11,3 +12,4 @@ return fromBase64(input.toString("base64"));

;
function decode(base64url, encoding = "utf8") {
function decode(base64url, encoding) {
if (encoding === void 0) { encoding = "utf8"; }
return Buffer.from(toBase64(base64url), "base64").toString(encoding);

@@ -30,3 +32,3 @@ }

}
let base64url = encode;
var base64url = encode;
base64url.encode = encode;

@@ -33,0 +35,0 @@ base64url.decode = decode;

14

dist/pad-string.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function padString(input) {
let segmentLength = 4;
let stringLength = input.length;
let diff = stringLength % segmentLength;
var segmentLength = 4;
var stringLength = input.length;
var diff = stringLength % segmentLength;
if (!diff) {
return input;
}
let position = stringLength;
let padLength = segmentLength - diff;
let paddedStringLength = stringLength + padLength;
let buffer = Buffer.alloc(paddedStringLength);
var position = stringLength;
var padLength = segmentLength - diff;
var paddedStringLength = stringLength + padLength;
var buffer = Buffer.alloc(paddedStringLength);
buffer.write(input);

@@ -15,0 +15,0 @@ while (padLength--) {

{
"name": "base64url",
"version": "3.0.0",
"version": "3.0.1",
"description": "For encoding to/from base64urls",
"main": "index.js",
"types": "./dist/base64url.d.ts",
"files": [

@@ -27,6 +28,9 @@ "dist/",

"readmeFilename": "README.md",
"engines": {
"node": ">=6.0.0"
},
"devDependencies": {
"@types/node": "^10.0.0",
"tap": "6.1.1"
"tap": "^12.1.0"
}
}

@@ -97,2 +97,7 @@ # base64url [![Build Status](https://secure.travis-ci.org/brianloveswords/base64url.png)](http://travis-ci.org/brianloveswords/base64url)

# Supported Node.js versions
This library should be used with current versions of the Node.js runtime's long-term stable (LTS)
schedule. More information can be found [at the Node.js Release Working Group](https://github.com/nodejs/Release) repo.
# License

@@ -99,0 +104,0 @@

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