Giter Club home page Giter Club logo

correcthorsebatterystaple.js's Introduction

Correct Horse Battery Staple

Yet another simple passphrase generator. See this XKCD for an explanation.

Installation

$ npm install correcthorsebatterystaple

Usage

Module

var chbs = require('correcthorsebatterystaple');
new chbs();

Options

You can configure the behavior by passing an options object:

new chbs({
    min: 15, // Mininum number of characters in returned passphrase. Default 20.
    max: 25, // Maximum number of characters in returned passphrase. Default 30.
    words: "enable.txt" // Use a different word list. Default "up-goer-five.txt".
});

When specifying a wordlist, if the file isn't found at the path specified, the code will fall back to checking the built-in wordlist directory for a file with the given name.

Callback

By default, the generated passphrase is sent to console.log. You can change this by passing a callback:

new chbs(function (pwd) {
    doSomethingWith(pwd);
});

new chbs({
    min: 16,
    max: 24
}, function (pwd) {
    doSomethingElseWith(pwd);
});

Command-line script

$ ./chbs
pick flip mad forget

Included word lists

  • up-goer-five.txt: The 1000 most common words in the English language.
  • enable.txt: The ENABLE word list (Enhanced North American Benchmark Lexicon).
  • top1000fr.txt: The 1000 most common words in the French language.
  • top1000de.txt: The 1000 most common words in the German language.
  • top1000nl.txt: The 1000 most common words in the Dutch language.

Thanks

correcthorsebatterystaple.js's People

Contributors

rfreebern avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

manchicken

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.