Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
daywiss committed Feb 17, 2017
1 parent 60efa77 commit 14cb578
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ to handle how to proceed when that happens. You can also peek at the next value
undefined, which means the next call will throw.
#API
##Provable(config)
Create a hash series and start the stateful engine.
##Provable(config,onChange)
Create a hash series and start the stateful engine. Optionally provide a state change callback.
All parameters are optional, but in practice you should provide at least a hash count to generate.
```js
var Provable = require('provable')
Expand All @@ -123,10 +124,13 @@ Create a hash series and start the stateful engine.
count: //the number of hashes in this series
seed: //a string to seed nodes crypto engine to start generating the first hash (last hash of series). Withold to seed with random hash.
clientSeed: //an additional seed value supplied, will update the hash before being returned from next()
onChange: //a function callback which returns the state of the engine after every change. Optionally poll state instead with engine.state()
}

var engine = Provable(config)
function onChange(state){
//persist state change somewhere
}

var engine = Provable(config,onChange)
//do stuff..
```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "provable",
"version": "0.2.0",
"version": "0.2.1",
"description": "A Provably fair random hash generator which can be plugged into [random-js](https://www.npmjs.com/package/random-js).",
"keywords": ["random","bitcoin","provable","random generator","random engine","random-js","gambling","provably random","bustabit","hashes","hash","sha256","fair","provably fair"],
"main": "index.js",
Expand Down

0 comments on commit 14cb578

Please sign in to comment.