New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

base64url-xplatform

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base64url-xplatform

A cross-platform implementation of base64 URL.

latest
Source
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

Base64Url Cross-Platform

A cross-platform implementation of base64 URL, with typescript definitions included.

Usage

Install via NPM and require in your project. There is also an ESM export, for use with browser or Deno.

const { Base64Url } = require('base64url-xplatform')
const header = { alg: 'RS256' }
const claimsSet = {
  iss: 'iss',
  sub: 'sub',
  aud: 'aud',
  exp: Math.floor(Date.now() / 1000) + 60 * 5
}
const encodedJWTHeader = Base64Url.encode(JSON.stringify(header))
const encodedJWTClaimsSet = Base64Url.encode(JSON.stringify(claimsSet))
const existingString = encodedJWTHeader + '.' + encodedJWTClaimsSet

Keywords

service

FAQs

Package last updated on 10 Aug 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