npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ringcentral/easy-pkce

v1.0.1

Published

A small typescript lib for generating code verifier and code exchange for the proof key of code exchange.

Downloads

2,406

Readme

EASY-PKCE

Build Status NPM version

Description

EASY-PKCE project is a small lib that generates strings for PKCE, as known as Proof Key for Code Exchange. PKCE is a mechanism that came into being to make the use of OAuth 2.0 Authorization Code grant more secure in certain cases. It was originally designed to protect mobile apps, but its ability to prevent authorization code injection makes it useful for every OAuth client, even web apps that use a client secret.

Usages

import {
  generateCodeChallenge,
  generateCodeVerifier,
  generateState,
  generateRandomString,
} from 'easy-pkce';

// get a base64url-encoded random string from a 32-octet sequence
const randomString = generateRandomString(32);

// get a url safe code verifier from a random 42-octet sequence
const codeVerifier_1 = generateCodeVerifier(42);
const codeVerifier_2 = generateCodeVerifier(); // default octet length is 32

// get a url safe state from a random 12-octet sequence
const state_1 = generateState(12);
const state_2 = generateState(); // default octet length is 32

// get the code challenge from the code verifier
const codeChallenge_1 = generateCodeChallenge(codeVerifier_1, 'plain'); // plain version
const codeChallenge_2 = generateCodeChallenge(codeVerifier_2, 'S256'); // S256 version

// get a pair of code verifier and code challenge
const {codeVerifier, codeChallenge} = generatePair("S256", 32);

LICENSE MIT