Skip to content

Commit

Permalink
Update the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
poing committed Jan 22, 2024
1 parent 6c4d6ba commit 99b1317
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ To use this project in it's current state **and for testing**, `Node` is require
The `JavaScript` wrapper **is not** intended to allow subsequent commands. It spawns an *indvidual* `subprocess` of `Node` for each function called.

```python
import js2pysecrets
from js2pysecrets import setRNG, random

js2pysecrets.setRNG('testRandom')
js2pysecrets.share('FFFF', 6, 3) # This will NOT use 'testRandom'
setRNG('testRandom')
random(32) # Output: '24c177c8'
random(32) # Output: '89535434'
random(32) # Output: '306e0c23'
```

While the `Javascript` *does* have code to allow subsequent commands, the only **INTENDED** use is to force the use of `testRandom` for testing purposes. This can be accomplished by over-riding the function with the kew-word argument `test=True`.
Expand All @@ -37,9 +39,9 @@ While the `Javascript` *does* have code to allow subsequent commands, the only *
from js2pysecrets import jsFunction

random = jsFunction('random', test=True)
random(32) # Output '075bcd15'
random(32) # Output '075bcd15'
random(32) # Output '075bcd15'
random(32) # Output: '075bcd15'
random(32) # Output: '075bcd15'
random(32) # Output: '075bcd15'
```


Expand Down
2 changes: 1 addition & 1 deletion js2pysecrets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __call__(self, *args, **kwargs):
combine = jsFunction('combine')
getConfig = jsFunction('getConfig')
extractShareComponents = jsFunction('extractShareComponents')
setRNG = jsNeedless('setRNG')
setRNG = jsFunction('setRNG')
str2hex = jsFunction('str2hex')
hex2str = jsFunction('hex2str')
random = jsFunction('random')
Expand Down

0 comments on commit 99b1317

Please sign in to comment.