Coder Social home page Coder Social logo

libwordentropy's Introduction

libwordentropy - Random pseudo-grammatical passphrase generator

https://www.wordentropy.org

API Documentation

Installation:

$ go get github.com/bkeroack/libwordentropy

Usage:

import (
	"log"
	"wordentropy"
)

g, err := wordentropy.LoadGenerator(&wordentropy.WordListOptions{
	Wordlist: "data/part-of-speech.txt",
})
if err != nil {
	log.Fatalf("Error loading wordlist: %v\n", err)
}

p, err := g.GeneratePassphrases(nil)  //default options

for i := range p{
	log.Printf("Passphrase: %v\n", p[i])	
}

Speed:

The majority of execution overhead is in loading and parsing the wordlist from disk (done by LoadGenerator())--in the range of several hundred milliseconds. After loading the wordlist, passphrase generation is performed in memory and is very fast.

Using go test -bench on my Macbook with default passphrase settings, each call to GeneratePassphrases() completes in submillisecond time (in many cases less than 1/10 millisecond).

Command Line Generator:

$ cd libwordentropy/we
$ go build
$ ./we --help
Usage of ./we:
  -add_number=false: add random digit to passphrase (password requirement workaround)
  -add_symbol=false: add random symbol to passphrase (password requirement workaround)
  -count=1: number of passphrases to generate
  -length=4: number of words per passphrase
  -no_spaces=false: no spaces between words
  -offensive_path="../data/offensive.txt": path to offensive wordlist (optional)
  -prude=false: filter offensive words
  -verbose=false: verbose output
  -wordlist_path="../data/part-of-speech.txt": path to POS wordlist

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.