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

checkr

v0.1.2

Published

A lightweight and secure checksum validator for passwords and other sensitive data.

Downloads

37

Readme

#Checkr

A secure way of storing passwords and other sensitive identification information on a database is to store the checksums of the data, instead of storing the data itself. If a database is hacked or otherwise inappropriately accessed, only the checksums can be obtained, making it very hard to discover the actual password used to login. When a login is requested, the checksums of the login password and the password stored in the database can be compared. Checkr provides a simple interface for verifying passwords, whose checksum objects or individual checksums can be easily stored on and read from a database. Checkr has been fully optimized at the ease of the V8 engine.

##Include Checkr

var checkr = require('checkr');

##Create a Checkr hash object

var phash = checkr('password');

##Checkr hash levels

1: 'md4',
2: 'md5',
4: 'sha',
8: 'sha1',
16: 'sha224',
32: 'sha256',
64: 'sha384',
128: 'sha512'

The hashtypes can be used as bitfields, to customize verification. Note: sha is sha-0.

Examples:
255:		full check
1 | 2:		md4 and md5
16 | 32: 	sha224 and sha256
2 | 8:		md5 and sha1

The standard (default) hashtype is 10, which uses md5 and sha1 to verify.

Hastypes can be passed in as a second argument to the checkr module.

##Checkr verify hash objects

phash._(qhash);

Returns a boolean, representing whether the objects are hash-equivalent.

##Example

var checkr = require('checkr');
var phash = checkr('password');
phash._(checkr('password')); // Returns true
phash._(checkr('spassword')); // Returns false

##Clarification

During benchmarking, checkr was shown to slow down greatly if the module itself was used as a function. Therefore the function checkr#_ was implemented in production.

##Speedtest

True Cases
1 Million Comprehensive Checks - Cached: 0 s, 314.317 ms
1 Million Standard Checks - Cached: 0 s, 86.000 ms
1 Million Basic Checks - Cached: 0 s, 48.131 ms

1 Thousand Comprehensive Checks - Cached: 0 s, 0.342 ms
1 Thousand Standard Checks - Cached: 0 s, 0.094 ms
1 Thousand Basic Checks - Cached: 0 s, 0.056 ms

1 Thousand Comprehensive Checks - Evaluated: 0 s, 210.983 ms
1 Thousand Standard Checks - Evaluated: 0 s, 67.534 ms
1 Thousand Basic Checks - Evaluated: 0 s, 15.228 ms

False Cases
1 Million Comprehensive Checks - Cached: 0 s, 52.174 ms
1 Million Standard Checks - Cached: 0 s, 51.852 ms
1 Million Basic Checks - Cached: 0 s, 51.580 ms

1 Thousand Comprehensive Checks - Cached: 0 s, 0.057 ms
1 Thousand Standard Checks - Cached: 0 s, 0.055 ms
1 Thousand Basic Checks - Cached: 0 s, 0.181 ms

1 Thousand Comprehensive Checks - Evaluated: 0 s, 195.526 ms
1 Thousand Standard Checks - Evaluated: 0 s, 40.295 ms
1 Thousand Basic Checks - Evaluated: 0 s, 40.676 ms