Skip to content

willscott/zipfian

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zipfian

Zipf Distribution Generation for Node.js

zipf distribution

Usage

To generate a zipf generator, create an instance of ZipfGenerator, and then get your numbers!

var zipfGenerator = require('zipfian').getGenerator(1000);

console.log(zipfGenerator.next());

If you want more control over the generator parameters, you can create the generator yourself.

var Generator = require('zipfian').ZipfGenerator;

var zipfGenerator = new Generator(min, max, zipfConstant);

Bugs + Contributing

Please submit bugs or feature requests in github issues. In particular, this implementation is missing the ability to resize the generator found in previous implementation. Contributions are welcome!

Todo

  • Resizing a generator
  • Scrambled generator

About

Zipf Distribution Generation for Node.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published