0.1.0 • Published 6 years ago
scatter-swap v0.1.0
scatter-swap-js
JavaScript implementation of Nathan and David Amick's Scatter Swap
Usage
Hashing
> new ScatterSwap(1).hash();
'4517239960'
> new ScatterSwap(2).hash();
'7023641925'
> new ScatterSwap(3).hash();
'2057964173'
Reverse Hashing
> new ScatterSwap(4517239960).reverseHash();
'0000000001'
> new ScatterSwap(7023641925).reverseHash();
'0000000002'
> new ScatterSwap(2057964173).reverseHash();
'0000000003'
Spin
> new ScatterSwap(1, 1234).hash();
'8169752143'
> new ScatterSwap(8169752143, 1234).reverseHash();
'0000000001'
Digit
You can specify length of digits within 10.
// 4 digits
> new ScatterSwap(1, 1234, 4).hash();
'3741'
> new ScatterSwap(3741, 1234, 4).reverseHash();
'0001'
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
License
MIT