seedgen

1.0.0 • Public • Published

seedgen

Easily generate seeded "random" values

Example

var generate = seedgen({color: 6, rotation: 360})
generate("middlerob")         // { color: 5, rotation: 71 }
generate("rob@middlerob.com") // { color: 2, rotation: 225 }
generate("middlerob")         // { color: 5, rotation: 71 }

seedgen returns a function that:

  1. Gives a color of 0 through 5 and a rotation of 0 through 359
  2. Always gives the same values for the same key/parameters

Try it out

Installation

Node/Browserify

npm install seedgen --save

Browser/RequireJS/CommonJS Standalone Package

Dev version seedgen-standalone.js

Minified seedgen-standalone.min.js

Development

npm install to load dependencies.

Run tests

npm test

Run tests automatically when files change

npm run testwatch

Build standlone versions

npm run standalone

Dependencies (2)

Dev Dependencies (6)

Package Sidebar

Install

npm i seedgen

Weekly Downloads

5

Version

1.0.0

License

MIT

Last publish

Collaborators

  • themiddleman