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

lighttoken

v1.0.37

Published

lightToken

Downloads

40

Readme

lightToken

license Build Status Join the chat at https://gitter.im/lighttoken/Lobby

NPM

Simple use Token.

Description

lightToken contains open-ssl-cipher-algorithms by three section like Json Web Token.

First Section

Encryption started with choosed one algorithm and key from options. Encryption data : payload

Second Section

Encryption contuniued with RC4-HMAC-MD5 algorithm and key. Encryption data : options + "." + lightTID

Third Section

Encryption contuniued with RC4-HMAC-MD5 algorithm and key. Encryption data : timestamped date now + "." + expire

Why ?

  • lightToken is simple. Open source.
  • Default installed crypto module for lightToken.
  • Flexible secure three level layer.
  • It is more secure than other Json Web Tokens with strongest open-ssl algorithms.
npm install lighttoken

Configuration

  • secretKey ( key ): A shared or secret key.
  • payload : Javascript Object or text.
  • options : algorithm ( Default : DES-EDE-CBC ), expire ( Default : 0 ( infite ) ).

Options :

  • algorithm. Please check algorithm list.
	https://gist.github.com/reggi/4459803#file-openssl-list-cipher-algorithms
  • expire.
	 "m" : minute , "h" : hour , "day" : day , "year" : year , "s" : second 

Usage :

var lightToken = require("lighttoken");


var key = "i9Ijt87Ao4zAPwP8jQZSn5X9ABAeBvMw";

var token = lightToken.authSign({ foo: 'bar' },key,{algorithm:"DES-EDE-CBC",expire:"1h"},function(data) {
	console.log(data);
});

var tokenVerify = lightToken.authVerify(token,key,function(data) {
	console.log(data);
});

lightToken.authSign(token, secretKey, options, [callback])

Returns :

  • Valid Values :
{ sign: "f16d6e37f9ab859655d48ec22f1c9c18.c651a664f843a743a8a665f744f3df1ad3b14556b19b62681e2a9e6c51fd19604d0d51c9c748f5be8edfeb068300b17e.ea7a4b17cd381a43e67a1c049ab4bac4ee559582a373129745a5d231cb440f1fe63033f40e9effce6f1213e1e1c0b39dc8b015850cd5264189996fe18fae9ec97b52f1e944d73849aca134789feeb112d82408fc50946a1cf75f295641e3bc88bbc28eab2d3a6d99cb7fc44df366a58ba578a8d40d380252e5d2934238db0451d1f33665dee52a81b29e4cebd7f482ad760033be67ff9203b0b95c72d107de861cfc9b07b9d84812d6c85add96ee7924afc456d3483420a0507f1f6c9b162da5565a5ddc993c7b3eebc699643e1005f68145e4d785f8de8e186d3aef05f29d315b4a9ea11d4a532b6acdb5ba409de8661f7973007173e4bac9c5966d19c9c9718e6ab1ae63ffb9e74888fa7fe57b528b7a3af60aff4069ffd387f1e10cf469865bcade4c052f30fc3786c9f6901f14c10e959ac708348c5d94800b4fdd93a9321db370853e68af0b",
  algorithm: "DES-EDE-CBC",
  expire: "3m",
  lightTID: "eyJmb28iOiJiYXIifXx8fDBrOGo3aDZnNWY0ZDNzMmFrOGo3aDZnNWY0ZDNzMmF8fHxUdWUgQXVnIDE2IDIwMTYgMTg6MjI6MjUgR01UKzAzMDAgKEdUQiBZYXogU2FhdGkp" }
  • Error Values :
{error:"auth Error"}

lightToken.authVerify(token, secretKey, options, [callback])

Returns :

  • Valid Values :
{ verify: { foo: 'bar' },
  lightTID: "eyJmb28iOiJiYXIifXx8fDBrOGo3aDZnNWY0ZDNzMmFrOGo3aDZnNWY0ZDNzMmF8fHxUdWUgQXVnIDE2IDIwMTYgMTg6MjI6MjUgR01UKzAzMDAgKEdUQiBZYXogU2FhdGkp" }
  • Error Values :
{error:"auth Error"}

Changelog

Version - 1.0.34

  • Text support added.

Version - 1.0.31

  • Date object changed to timestamp.
  • Changed algorithm2 & algorithm3 with "RC4-HMAC-MD5"
  • Fixes for large tokens

Support

Need help or have a question?

Do you want to donate ?

Support on Gratipay