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

pass

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pass

Apache htpasswd password generator/validator

latest
Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
171
10.32%
Maintainers
1
Weekly downloads
 
Created
Source

pass

Simple module for Node.JS to generate/validate passwords from Apache htpasswd files.

The module supports Apache Basic Auth password formats - crypt(3), apr1/md5, sha1, plain.

All generated passwords are in sha1 format.

Requirements

  • OpenSSL

Installation

npm install pass

Usage

Simple use-case - generate a hash from a password and validate it.

var pass = require("pass");

var password = "myPassword";

// generate a password hash
pass.generate(password, function(error, hash){
    if(error){
        console.log("Error occured: "+error.message);
        return;
    }


    // validate a password
    pass.validate(password, hash, function(error, success){
        if(error){
            console.log("Error occured: "+error.message);
            return;
        }

        console.log(success?"Passwords matched!":"No match!");
    });

});

See test.js for a better example

License

MIT

Keywords

apache

FAQs

Package last updated on 11 Sep 2014

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