mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-06 19:03:49 +00:00
Compare commits
327 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2fdc5b942 | ||
|
|
450b0a571a | ||
|
|
5c4382c3c1 | ||
|
|
c3c7cebfe4 | ||
|
|
58d84449f4 | ||
|
|
9303d0e078 | ||
|
|
bd1f1706fe | ||
|
|
8d119065f0 | ||
|
|
45a8e2a218 | ||
|
|
d035063dcc | ||
|
|
26d2c54381 | ||
|
|
ecbc254ba3 | ||
|
|
874b6d4e08 | ||
|
|
1fa3f997a2 | ||
|
|
4cf9de3202 | ||
|
|
c04d31f82f | ||
|
|
530a9f6047 | ||
|
|
126af2bee3 | ||
|
|
c7e1af7300 | ||
|
|
c4f0c2908f | ||
|
|
941b099f14 | ||
|
|
83f23081a3 | ||
|
|
1dab87d842 | ||
|
|
83c580c678 | ||
|
|
8b44f5d19a | ||
|
|
a7705b8ebc | ||
|
|
f2081ee467 | ||
|
|
f50464249c | ||
|
|
ed720546bf | ||
|
|
e8f27ba2c3 | ||
|
|
be946a2061 | ||
|
|
a636b24619 | ||
|
|
f8fd590588 | ||
|
|
02eeb81713 | ||
|
|
18d64d9586 | ||
|
|
5b5b11fd96 | ||
|
|
2c86fb4746 | ||
|
|
85711db3bb | ||
|
|
1820b6ac67 | ||
|
|
b500a60e28 | ||
|
|
942de1bc5e | ||
|
|
43bef4e19d | ||
|
|
20bd34b014 | ||
|
|
23f393acfb | ||
|
|
c560e01e91 | ||
|
|
a362ff2f62 | ||
|
|
9a82f12b91 | ||
|
|
5e376b8903 | ||
|
|
90422a41af | ||
|
|
f3314418fb | ||
|
|
7da8c22eaf | ||
|
|
d9ad938b52 | ||
|
|
f7f579f5f5 | ||
|
|
2cd19306b2 | ||
|
|
545348d159 | ||
|
|
8835afe8a2 | ||
|
|
38e6aaed84 | ||
|
|
f7125606bf | ||
|
|
5b0b1a5c9a | ||
|
|
71573cb380 | ||
|
|
c64ff95697 | ||
|
|
6d2e202083 | ||
|
|
0cb81e1117 | ||
|
|
32ade2fbf7 | ||
|
|
ac7f150a79 | ||
|
|
134213954d | ||
|
|
253f4cb75f | ||
|
|
ebbb057dfa | ||
|
|
38626a2d1f | ||
|
|
990ce0d072 | ||
|
|
1ca3784b0a | ||
|
|
1b54929bda | ||
|
|
d75ddf4ea8 | ||
|
|
ad07c1c0b5 | ||
|
|
0b911fc20f | ||
|
|
73ccaa1357 | ||
|
|
bd1ecd20f9 | ||
|
|
e3668fb51f | ||
|
|
3c222e57df | ||
|
|
16ff1df7ab | ||
|
|
f2f8d8177e | ||
|
|
877b8bdfec | ||
|
|
5e211c6959 | ||
|
|
4e59e7d6fc | ||
|
|
8c3a56ec4f | ||
|
|
d31a0ad44b | ||
|
|
4566751b89 | ||
|
|
b386aaa06e | ||
|
|
ef95b4bfad | ||
|
|
30e3d246d4 | ||
|
|
647410b4a6 | ||
|
|
4669c88c67 | ||
|
|
9e865b8e75 | ||
|
|
08713ff9c2 | ||
|
|
ed52cda20d | ||
|
|
8ce57f3c13 | ||
|
|
043717034b | ||
|
|
eb100ec0e4 | ||
|
|
5cbd174c18 | ||
|
|
75722c6d24 | ||
|
|
7e75b98e1f | ||
|
|
47dbf58b6d | ||
|
|
42e00ef56a | ||
|
|
8dbf7d5837 | ||
|
|
bf96267f89 | ||
|
|
995bc58791 | ||
|
|
d7125cda1d | ||
|
|
b674c5710b | ||
|
|
920f7aa078 | ||
|
|
5c6e875f2d | ||
|
|
e086305895 | ||
|
|
863eee8ed7 | ||
|
|
4729ecca04 | ||
|
|
fba7e98aea | ||
|
|
95b306106f | ||
|
|
f32b24e380 | ||
|
|
26767a2ce3 | ||
|
|
a748c4b5c6 | ||
|
|
eaf7892872 | ||
|
|
677d18f2e0 | ||
|
|
f3051a6a9f | ||
|
|
bf528f65f4 | ||
|
|
5699633538 | ||
|
|
d1d8699fc4 | ||
|
|
e284827677 | ||
|
|
115eb45083 | ||
|
|
0d78c2a120 | ||
|
|
7594405011 | ||
|
|
d359fe64b2 | ||
|
|
1bf76fe32d | ||
|
|
904e39748c | ||
|
|
46054e445e | ||
|
|
4958ea8009 | ||
|
|
0e1fd95302 | ||
|
|
a823e5266c | ||
|
|
b64fb35301 | ||
|
|
54600393af | ||
|
|
ff2940e81e | ||
|
|
f3101bd3f1 | ||
|
|
46a5338e42 | ||
|
|
c578337f0f | ||
|
|
90f7a5ec93 | ||
|
|
dd496c82c1 | ||
|
|
1dafc30db4 | ||
|
|
927450e169 | ||
|
|
a67554c649 | ||
|
|
0bc6361db4 | ||
|
|
a98d40c43d | ||
|
|
54a8e781b4 | ||
|
|
c1d6274224 | ||
|
|
c16661aeea | ||
|
|
e9491c7efd | ||
|
|
d07983bc1f | ||
|
|
3aa7677ace | ||
|
|
9e04576e2f | ||
|
|
8131a07115 | ||
|
|
181b5d61e3 | ||
|
|
4dfc681f71 | ||
|
|
dfb4fd1be5 | ||
|
|
aa793f572f | ||
|
|
6973e692b0 | ||
|
|
22f8766947 | ||
|
|
8017442c50 | ||
|
|
82cf26c1cb | ||
|
|
206cbafceb | ||
|
|
9cf02dd452 | ||
|
|
f12242014d | ||
|
|
244c76022a | ||
|
|
516c16d721 | ||
|
|
f7e9fdf002 | ||
|
|
5c203fab6a | ||
|
|
40d542ba58 | ||
|
|
cc3c35487f | ||
|
|
76531b610a | ||
|
|
c845ee6f6e | ||
|
|
c394ec3c4f | ||
|
|
55367b989e | ||
|
|
732613e44c | ||
|
|
9ce31d3509 | ||
|
|
f8fae68efb | ||
|
|
93f3a286db | ||
|
|
3799728c76 | ||
|
|
b130271b2b | ||
|
|
ea2cb91a49 | ||
|
|
bfe1963eaa | ||
|
|
a04946e23e | ||
|
|
700294714c | ||
|
|
d93f2ba9f0 | ||
|
|
96ee8ab0a0 | ||
|
|
659b06a7b8 | ||
|
|
653538cd3a | ||
|
|
1ba5816184 | ||
|
|
0a23f51792 | ||
|
|
b9b3eaf670 | ||
|
|
7b29420f1a | ||
|
|
909297015e | ||
|
|
c7a092db32 | ||
|
|
de5fe245cc | ||
|
|
4dc041d77e | ||
|
|
7cfd04e318 | ||
|
|
d0428a8d21 | ||
|
|
3dbf117928 | ||
|
|
342ff964aa | ||
|
|
75138beed9 | ||
|
|
36523e0d97 | ||
|
|
44e705cd31 | ||
|
|
3e2af09e07 | ||
|
|
907172d6f0 | ||
|
|
394bce7c9e | ||
|
|
bc32c84166 | ||
|
|
76120cb0b4 | ||
|
|
385ee32fd4 | ||
|
|
5b689bd6e7 | ||
|
|
ac537983d9 | ||
|
|
5b2edb3998 | ||
|
|
eee4a60b35 | ||
|
|
dedb054fd8 | ||
|
|
079635cba1 | ||
|
|
5db3540e89 | ||
|
|
b502adc910 | ||
|
|
cab37a96c4 | ||
|
|
b603572295 | ||
|
|
8817e2487a | ||
|
|
c6c86591a9 | ||
|
|
5d1bb7d776 | ||
|
|
ea96c345cc | ||
|
|
318ec4dc9f | ||
|
|
ec38b3a263 | ||
|
|
9cec5dd2b7 | ||
|
|
31264e8bea | ||
|
|
e440d504fb | ||
|
|
786cd442cd | ||
|
|
9f675f2e47 | ||
|
|
e5c4aa4098 | ||
|
|
45e40c288f | ||
|
|
519e9dc728 | ||
|
|
67f18e2a63 | ||
|
|
c4f4208b95 | ||
|
|
881fbe2234 | ||
|
|
c7a1a00040 | ||
|
|
6aa2c1d26d | ||
|
|
9e836ac8e6 | ||
|
|
e2186682ac | ||
|
|
152f0ce966 | ||
|
|
084ff40d4f | ||
|
|
b244e34403 | ||
|
|
e33f4b2704 | ||
|
|
6c733477db | ||
|
|
a36c509c91 | ||
|
|
7d4e4cbe26 | ||
|
|
82e3938afe | ||
|
|
06cd4e7608 | ||
|
|
8b569deeae | ||
|
|
ad59508d7c | ||
|
|
562ece8004 | ||
|
|
8e3b890d26 | ||
|
|
6f53a445ee | ||
|
|
858c29e3be | ||
|
|
5a085aed79 | ||
|
|
7d68d5474e | ||
|
|
21e2e6c951 | ||
|
|
7f59c88dbc | ||
|
|
b85da0745a | ||
|
|
0ae59396f5 | ||
|
|
3451d1a81b | ||
|
|
22bb112ead | ||
|
|
af14981d83 | ||
|
|
9f3c111766 | ||
|
|
c2e4f93870 | ||
|
|
8e2d37d450 | ||
|
|
29040f3c8b | ||
|
|
6746a9a45e | ||
|
|
c768923b77 | ||
|
|
0d0099e633 | ||
|
|
bea736aeae | ||
|
|
31190ced31 | ||
|
|
575ee4de2c | ||
|
|
dfa696859a | ||
|
|
32b5b0363f | ||
|
|
c69e40942e | ||
|
|
8cb07685fd | ||
|
|
81a5a871d9 | ||
|
|
3e7b1ac938 | ||
|
|
16afe3ecbf | ||
|
|
2885ddd5f7 | ||
|
|
f9ab643475 | ||
|
|
17bb7e6953 | ||
|
|
b615704d4a | ||
|
|
c47f0030ec | ||
|
|
cb0300fc7b | ||
|
|
7cbfce747a | ||
|
|
dd99c5fde9 | ||
|
|
c4a09d67eb | ||
|
|
bf13c95fb0 | ||
|
|
30d6779baa | ||
|
|
d0889ab9de | ||
|
|
478e54ad47 | ||
|
|
3b36d6c3ba | ||
|
|
b9f4ee2d4e | ||
|
|
1b419bc615 | ||
|
|
961df0a5a5 | ||
|
|
491948dbcb | ||
|
|
7a11300336 | ||
|
|
dba22db54d | ||
|
|
6cbd3bc8c2 | ||
|
|
74762b369e | ||
|
|
5d7f36e9b2 | ||
|
|
b0be9d8b60 | ||
|
|
9d9fefbb28 | ||
|
|
584d1a41c7 | ||
|
|
a938c2f5a5 | ||
|
|
9f83f0fcd7 | ||
|
|
10980ed68c | ||
|
|
612d6b4206 | ||
|
|
d354a1dfab | ||
|
|
d52d3f3784 | ||
|
|
22c443df83 | ||
|
|
8ffa333bc9 | ||
|
|
5cdbe4620a | ||
|
|
8253325365 | ||
|
|
d100f3c0cb | ||
|
|
c1322c7c89 | ||
|
|
d9b5b5d0de | ||
|
|
97bde20b84 | ||
|
|
b1100c66eb | ||
|
|
611f76238d | ||
|
|
7ef0db981f |
132
changelog.md
132
changelog.md
@@ -1,3 +1,135 @@
|
||||
# 0.5.4
|
||||
|
||||
* Add Particl network
|
||||
* Add Divi network
|
||||
* Add option to turn autocompute on / off
|
||||
* Add option to set custom number of pbkdf2 rounds
|
||||
* Fix blank mnemonic errors when using only seed
|
||||
|
||||
# 0.5.3
|
||||
|
||||
Add Starname network
|
||||
Add Terra network
|
||||
Add Bitcoin Private network
|
||||
Add Thorchain network
|
||||
Change Xwc network to Xwcc and add new Xwc
|
||||
Fix Bip85 works without mnemonic (using xprv)
|
||||
Fix extended key not updating when switching tabs
|
||||
Fix incorrect html closing tag
|
||||
|
||||
# 0.5.2
|
||||
|
||||
* Show ethereum private keys with correct padding
|
||||
|
||||
# 0.5.1
|
||||
|
||||
* Add Portuguese language
|
||||
* Add BIP85
|
||||
* Add Ritocoin
|
||||
* Add Cosmos Hub
|
||||
* Add ZooBC
|
||||
* Add Zcoin/Firo rebranded coin
|
||||
* Update Namecoin WIF
|
||||
|
||||
# 0.5.0
|
||||
|
||||
* Remove bias from base 6 and base 10 entropy
|
||||
* Add notes about card entropy
|
||||
* Hide/show split mnemonic cards
|
||||
* Fix link to standalone release file
|
||||
* Add Scribe network
|
||||
* Add Nano network
|
||||
* Add TRX network
|
||||
* Add Binance Smart Chain network
|
||||
* Clean up dependencies for eos-util
|
||||
* Update bootstrap to 3.4.1
|
||||
* Bump library versions
|
||||
|
||||
# 0.4.3
|
||||
|
||||
* Add FIO - Foundation for Interwallet Operability
|
||||
* Add Argoneum
|
||||
* Add CranePay
|
||||
* Add Jingtum network
|
||||
* Add MOAC
|
||||
* Update RSK network
|
||||
* Add HandShake
|
||||
* Add Sugarchain testnet
|
||||
* Fix wording "is a checksum" / "contains a checksum"
|
||||
* Fix bech32 prefix for monacoin
|
||||
|
||||
# 0.4.2
|
||||
|
||||
* Fix ethereum private key format
|
||||
|
||||
# 0.4.1
|
||||
|
||||
* Fix no loading on chrome with third-party cookies blocked
|
||||
* Add EtherCore
|
||||
* Add RSK network
|
||||
* Add DeepOnion segwit parameters
|
||||
* Fix ethereum xpub derivation
|
||||
|
||||
# 0.4.0
|
||||
|
||||
* Third party libraries deduplicated and minified
|
||||
* Add text reminder for multibit wallet change addresses
|
||||
* Seed field can be edited
|
||||
* Add bitcoin regtest parameters
|
||||
* Mnemonic conversion to entropy is hex encoded instead of binary
|
||||
* Entropy type can be manually selected
|
||||
* Add Bitcoin P2WSH and P2WSH-P2SH
|
||||
* Add Czech language
|
||||
|
||||
# 0.3.14
|
||||
|
||||
* Ethereum uses standard BIP44 as per majority of wallets (Issue 378)
|
||||
|
||||
# 0.3.13
|
||||
|
||||
* Add Thought network
|
||||
* Add Energyweb network
|
||||
* Add Elastos network
|
||||
* Add Groestlcoin
|
||||
* Fix for syscoin network
|
||||
* Add BSV, RPD, MONKEY, ARYA
|
||||
* Rename Zencash to Horizen
|
||||
* Update Hush network
|
||||
* Add CasinoCoin
|
||||
* Add CPUchain
|
||||
* Add Wagerr
|
||||
* Add VeChain
|
||||
* Option to not use 'change' field for ethereum networks in bip45
|
||||
* Add segwit parameters for MONKEY, BCA, BTC, MONA, SYS, VIA, DOGEt, LTCt
|
||||
* Convert mnemonic back to raw entropy
|
||||
* Add 2-of-3 phrase cards
|
||||
* Move position of hardened addresses checkbox to address table
|
||||
|
||||
# 0.3.12
|
||||
|
||||
* Fix typos
|
||||
* Fix DigiByte signing message
|
||||
* Add DeepOnion network
|
||||
* Add EOS network
|
||||
* Add LTC testnetwork
|
||||
* Add DOGE testnetwork
|
||||
* Add Stellar network
|
||||
* Add TWINS network
|
||||
* Add FIX network
|
||||
|
||||
# 0.3.11
|
||||
|
||||
* Add NIX network
|
||||
* Fix coin parameters for NMC, XMY, CLAM, ONX, LKR
|
||||
* Add DEXON network
|
||||
* Add Nebulas network
|
||||
* Add LSP network
|
||||
* Fix Crown network address format
|
||||
* Add Ellaism network
|
||||
* Add Etheresocial network
|
||||
* Add Bolivarcoin network
|
||||
* Force spellcheck and autocomplete to be off
|
||||
|
||||
# 0.3.10
|
||||
|
||||
* Add Phore network
|
||||
|
||||
58
dev_env_setup.sh
Executable file
58
dev_env_setup.sh
Executable file
@@ -0,0 +1,58 @@
|
||||
# this script is intended to be run in a VM
|
||||
# running ubuntu 20.04 server
|
||||
# from the root directory of this repo
|
||||
|
||||
echo "This script is intended to be run in a VM."
|
||||
echo "It may do things to your OS that you don't want to be peristent."
|
||||
echo "Please type virtualmachine to continue, or Ctrl-C to quit."
|
||||
|
||||
read passage
|
||||
|
||||
if [ "$passage" = "virtualmachine" ]; then
|
||||
echo "Installing dev environment"
|
||||
else
|
||||
echo "Did not type virtualmachine, quitting with no changes applied"
|
||||
exit
|
||||
fi
|
||||
|
||||
# set up place for local binaries
|
||||
mkdir $HOME/.bin
|
||||
echo "export PATH=$PATH:$HOME/.bin" >> $HOME/.bashrc
|
||||
source $HOME/.bashrc
|
||||
|
||||
# allow python3 to be run with python command
|
||||
ln -s /usr/bin/python3 $HOME/.bin/python
|
||||
|
||||
# install firefox and other dependencies
|
||||
sudo apt-get -y install firefox unzip openjdk-11-jre-headless xvfb libxi6 libgconf-2-4 make build-essential
|
||||
# install chrome
|
||||
curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add
|
||||
sudo sh -c "echo \"deb https://dl.google.com/linux/chrome/deb/ stable main\" >> /etc/apt/sources.list.d/google-chrome.list"
|
||||
sudo apt-get -y update
|
||||
sudo apt-get -y install google-chrome-stable
|
||||
|
||||
# install nodejs for running tests
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash
|
||||
# load nvm
|
||||
source $HOME/.bashrc
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||
# install latest node
|
||||
nvm install node
|
||||
# install jasmine
|
||||
cd tests
|
||||
npm install --global jasmine
|
||||
npm install selenium-webdriver
|
||||
# install gecko webdriver for firefox
|
||||
wget https://github.com/mozilla/geckodriver/releases/download/v0.29.0/geckodriver-v0.29.0-linux64.tar.gz --output-document=/tmp/geckodriver.tar.gz
|
||||
tar -xf /tmp/geckodriver.tar.gz -C $HOME/.bin
|
||||
# install chrome webdriver for chromium
|
||||
wget https://chromedriver.storage.googleapis.com/88.0.4324.96/chromedriver_linux64.zip --output-document=/tmp/chromedriver.zip
|
||||
unzip /tmp/chromedriver.zip -d $HOME/.bin
|
||||
|
||||
# to run tests
|
||||
# cd tests
|
||||
# Xvfb :1 -screen 1 1024x768x24 & export DISPLAY=:1.1
|
||||
# BROWSER=firefox jasmine spec/tests.js
|
||||
# BROWSER=chrome jasmine spec/tests.js
|
||||
22
libs/base-x/LICENSE.md
Normal file
22
libs/base-x/LICENSE.md
Normal file
@@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 base-x contributors
|
||||
Copyright (c) 2014-2018 The Bitcoin Core developers
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
44
libs/base-x/package.json
Normal file
44
libs/base-x/package.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "base-x",
|
||||
"version": "3.0.7",
|
||||
"description": "Fast base encoding / decoding of any given alphabet",
|
||||
"keywords": [
|
||||
"base-x",
|
||||
"base58",
|
||||
"base62",
|
||||
"base64",
|
||||
"crypto",
|
||||
"crytography",
|
||||
"decode",
|
||||
"decoding",
|
||||
"encode",
|
||||
"encoding"
|
||||
],
|
||||
"homepage": "https://github.com/cryptocoinjs/base-x",
|
||||
"bugs": {
|
||||
"url": "https://github.com/cryptocoinjs/base-x/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": "Daniel Cousens",
|
||||
"files": [
|
||||
"src"
|
||||
],
|
||||
"main": "src/index.js",
|
||||
"types": "src/index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/cryptocoinjs/base-x.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc -p ./tsconfig.json ; standard --fix; browserify src/index.js --standalone basex > /tmp/base-x.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "12.0.10",
|
||||
"standard": "^10.0.3",
|
||||
"tape": "^4.5.1",
|
||||
"typescript": "3.5.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
}
|
||||
4
libs/base-x/readme.md
Normal file
4
libs/base-x/readme.md
Normal file
@@ -0,0 +1,4 @@
|
||||
Build (will create a bundle and copy it to /tmp/base-x.js):
|
||||
|
||||
npm install
|
||||
npm run build
|
||||
161
libs/base-x/ts_src/index.ts
Normal file
161
libs/base-x/ts_src/index.ts
Normal file
@@ -0,0 +1,161 @@
|
||||
// base-x encoding / decoding
|
||||
// Copyright (c) 2018 base-x contributors
|
||||
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
// @ts-ignore
|
||||
const _Buffer = require('safe-buffer').Buffer;
|
||||
|
||||
function base (ALPHABET: string): base.BaseConverter {
|
||||
if (ALPHABET.length >= 255) throw new TypeError('Alphabet too long')
|
||||
|
||||
const BASE_MAP = new Uint8Array(256)
|
||||
BASE_MAP.fill(255)
|
||||
|
||||
for (let i = 0; i < ALPHABET.length; i++) {
|
||||
const x = ALPHABET.charAt(i)
|
||||
const xc = x.charCodeAt(0)
|
||||
|
||||
if (BASE_MAP[xc] !== 255) throw new TypeError(x + ' is ambiguous')
|
||||
BASE_MAP[xc] = i
|
||||
}
|
||||
|
||||
const BASE = ALPHABET.length
|
||||
const LEADER = ALPHABET.charAt(0)
|
||||
const FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up
|
||||
const iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up
|
||||
|
||||
function encode (source: Buffer): string {
|
||||
if (!_Buffer.isBuffer(source)) throw new TypeError('Expected Buffer')
|
||||
if (source.length === 0) return ''
|
||||
|
||||
// Skip & count leading zeroes.
|
||||
let zeroes = 0
|
||||
let length = 0
|
||||
let pbegin = 0
|
||||
const pend = source.length
|
||||
|
||||
while (pbegin !== pend && source[pbegin] === 0) {
|
||||
pbegin++
|
||||
zeroes++
|
||||
}
|
||||
|
||||
// Allocate enough space in big-endian base58 representation.
|
||||
const size = ((pend - pbegin) * iFACTOR + 1) >>> 0
|
||||
const b58 = new Uint8Array(size)
|
||||
|
||||
// Process the bytes.
|
||||
while (pbegin !== pend) {
|
||||
let carry = source[pbegin]
|
||||
|
||||
// Apply "b58 = b58 * 256 + ch".
|
||||
let i = 0
|
||||
for (let it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
|
||||
carry += (256 * b58[it1]) >>> 0
|
||||
b58[it1] = (carry % BASE) >>> 0
|
||||
carry = (carry / BASE) >>> 0
|
||||
}
|
||||
|
||||
if (carry !== 0) throw new Error('Non-zero carry')
|
||||
length = i
|
||||
pbegin++
|
||||
}
|
||||
|
||||
// Skip leading zeroes in base58 result.
|
||||
let it2 = size - length
|
||||
while (it2 !== size && b58[it2] === 0) {
|
||||
it2++
|
||||
}
|
||||
|
||||
// Translate the result into a string.
|
||||
let str = LEADER.repeat(zeroes)
|
||||
for (; it2 < size; ++it2) str += ALPHABET.charAt(b58[it2])
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
function decodeUnsafe (source: string): Buffer | undefined {
|
||||
if (typeof source !== 'string') throw new TypeError('Expected String')
|
||||
if (source.length === 0) return _Buffer.alloc(0)
|
||||
|
||||
let psz = 0
|
||||
|
||||
// Skip leading spaces.
|
||||
if (source[psz] === ' ') return
|
||||
|
||||
// Skip and count leading '1's.
|
||||
let zeroes = 0
|
||||
let length = 0
|
||||
while (source[psz] === LEADER) {
|
||||
zeroes++
|
||||
psz++
|
||||
}
|
||||
|
||||
// Allocate enough space in big-endian base256 representation.
|
||||
const size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.
|
||||
const b256 = new Uint8Array(size)
|
||||
|
||||
// Process the characters.
|
||||
while (source[psz]) {
|
||||
// Decode character
|
||||
let carry = BASE_MAP[source.charCodeAt(psz)]
|
||||
|
||||
// Invalid character
|
||||
if (carry === 255) return
|
||||
|
||||
let i = 0
|
||||
for (let it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
|
||||
carry += (BASE * b256[it3]) >>> 0
|
||||
b256[it3] = (carry % 256) >>> 0
|
||||
carry = (carry / 256) >>> 0
|
||||
}
|
||||
|
||||
if (carry !== 0) throw new Error('Non-zero carry')
|
||||
length = i
|
||||
psz++
|
||||
}
|
||||
|
||||
// Skip trailing spaces.
|
||||
if (source[psz] === ' ') return
|
||||
|
||||
// Skip leading zeroes in b256.
|
||||
let it4 = size - length
|
||||
while (it4 !== size && b256[it4] === 0) {
|
||||
it4++
|
||||
}
|
||||
|
||||
const vch = _Buffer.allocUnsafe(zeroes + (size - it4))
|
||||
vch.fill(0x00, 0, zeroes)
|
||||
|
||||
let j = zeroes
|
||||
while (it4 !== size) {
|
||||
vch[j++] = b256[it4++]
|
||||
}
|
||||
|
||||
return vch
|
||||
}
|
||||
|
||||
function decode (string: string): Buffer {
|
||||
const buffer = decodeUnsafe(string)
|
||||
if (buffer) return buffer
|
||||
|
||||
throw new Error('Non-base' + BASE + ' character')
|
||||
}
|
||||
|
||||
return {
|
||||
encode: encode,
|
||||
decodeUnsafe: decodeUnsafe,
|
||||
decode: decode
|
||||
}
|
||||
}
|
||||
|
||||
export = base;
|
||||
|
||||
declare namespace base {
|
||||
interface BaseConverter {
|
||||
encode(buffer: Buffer): string;
|
||||
decodeUnsafe(string: string): Buffer | undefined;
|
||||
decode(string: string): Buffer;
|
||||
}
|
||||
}
|
||||
31
libs/base-x/tsconfig.json
Normal file
31
libs/base-x/tsconfig.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES5",
|
||||
"module": "commonjs",
|
||||
"outDir": "./src",
|
||||
"declaration": true,
|
||||
"rootDir": "./ts_src",
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"allowJs": false,
|
||||
"strict": true,
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictBindCallApply": true,
|
||||
"strictPropertyInitialization": true,
|
||||
"noImplicitThis": true,
|
||||
"alwaysStrict": true,
|
||||
"esModuleInterop": false,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true
|
||||
},
|
||||
"include": [
|
||||
"ts_src/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"**/*.spec.ts",
|
||||
"node_modules/**/*"
|
||||
]
|
||||
}
|
||||
244
libs/bitcoinjs-bip38/index.js
Normal file
244
libs/bitcoinjs-bip38/index.js
Normal file
@@ -0,0 +1,244 @@
|
||||
var aes = require('browserify-aes')
|
||||
var assert = require('assert')
|
||||
var Buffer = require('safe-buffer').Buffer
|
||||
var bs58check = require('bs58check')
|
||||
var createHash = require('create-hash')
|
||||
var scrypt = require('scryptsy')
|
||||
var xor = require('buffer-xor/inplace')
|
||||
|
||||
var ecurve = require('ecurve')
|
||||
var curve = ecurve.getCurveByName('secp256k1')
|
||||
|
||||
var BigInteger = require('bigi')
|
||||
|
||||
// constants
|
||||
var SCRYPT_PARAMS = {
|
||||
N: 16384, // specified by BIP38
|
||||
r: 8,
|
||||
p: 8
|
||||
}
|
||||
var NULL = Buffer.alloc(0)
|
||||
|
||||
function hash160 (buffer) {
|
||||
var hash
|
||||
try {
|
||||
hash = createHash('rmd160')
|
||||
} catch (e) {
|
||||
hash = createHash('ripemd160')
|
||||
}
|
||||
return hash.update(
|
||||
createHash('sha256').update(buffer).digest()
|
||||
).digest()
|
||||
}
|
||||
|
||||
function hash256 (buffer) {
|
||||
return createHash('sha256').update(
|
||||
createHash('sha256').update(buffer).digest()
|
||||
).digest()
|
||||
}
|
||||
|
||||
function getAddress (d, compressed) {
|
||||
var Q = curve.G.multiply(d).getEncoded(compressed)
|
||||
var hash = hash160(Q)
|
||||
var payload = Buffer.allocUnsafe(21)
|
||||
payload.writeUInt8(0x00, 0) // XXX TODO FIXME bitcoin only??? damn you BIP38
|
||||
hash.copy(payload, 1)
|
||||
|
||||
return bs58check.encode(payload)
|
||||
}
|
||||
|
||||
function encryptRaw (buffer, compressed, passphrase, progressCallback, scryptParams) {
|
||||
if (buffer.length !== 32) throw new Error('Invalid private key length')
|
||||
scryptParams = scryptParams || SCRYPT_PARAMS
|
||||
|
||||
var d = BigInteger.fromBuffer(buffer)
|
||||
var address = getAddress(d, compressed)
|
||||
var secret = Buffer.from(passphrase, 'utf8')
|
||||
var salt = hash256(address).slice(0, 4)
|
||||
|
||||
var N = scryptParams.N
|
||||
var r = scryptParams.r
|
||||
var p = scryptParams.p
|
||||
|
||||
var scryptBuf = scrypt(secret, salt, N, r, p, 64, progressCallback)
|
||||
var derivedHalf1 = scryptBuf.slice(0, 32)
|
||||
var derivedHalf2 = scryptBuf.slice(32, 64)
|
||||
|
||||
var xorBuf = xor(derivedHalf1, buffer)
|
||||
var cipher = aes.createCipheriv('aes-256-ecb', derivedHalf2, NULL)
|
||||
cipher.setAutoPadding(false)
|
||||
cipher.end(xorBuf)
|
||||
|
||||
var cipherText = cipher.read()
|
||||
|
||||
// 0x01 | 0x42 | flagByte | salt (4) | cipherText (32)
|
||||
var result = Buffer.allocUnsafe(7 + 32)
|
||||
result.writeUInt8(0x01, 0)
|
||||
result.writeUInt8(0x42, 1)
|
||||
result.writeUInt8(compressed ? 0xe0 : 0xc0, 2)
|
||||
salt.copy(result, 3)
|
||||
cipherText.copy(result, 7)
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
function encrypt (buffer, compressed, passphrase, progressCallback, scryptParams) {
|
||||
return bs58check.encode(encryptRaw(buffer, compressed, passphrase, progressCallback, scryptParams))
|
||||
}
|
||||
|
||||
// some of the techniques borrowed from: https://github.com/pointbiz/bitaddress.org
|
||||
function decryptRaw (buffer, passphrase, progressCallback, scryptParams) {
|
||||
// 39 bytes: 2 bytes prefix, 37 bytes payload
|
||||
if (buffer.length !== 39) throw new Error('Invalid BIP38 data length')
|
||||
if (buffer.readUInt8(0) !== 0x01) throw new Error('Invalid BIP38 prefix')
|
||||
scryptParams = scryptParams || SCRYPT_PARAMS
|
||||
|
||||
// check if BIP38 EC multiply
|
||||
var type = buffer.readUInt8(1)
|
||||
if (type === 0x43) return decryptECMult(buffer, passphrase, progressCallback, scryptParams)
|
||||
if (type !== 0x42) throw new Error('Invalid BIP38 type')
|
||||
|
||||
passphrase = Buffer.from(passphrase, 'utf8')
|
||||
|
||||
var flagByte = buffer.readUInt8(2)
|
||||
var compressed = flagByte === 0xe0
|
||||
if (!compressed && flagByte !== 0xc0) throw new Error('Invalid BIP38 compression flag')
|
||||
|
||||
var N = scryptParams.N
|
||||
var r = scryptParams.r
|
||||
var p = scryptParams.p
|
||||
|
||||
var salt = buffer.slice(3, 7)
|
||||
var scryptBuf = scrypt(passphrase, salt, N, r, p, 64, progressCallback)
|
||||
var derivedHalf1 = scryptBuf.slice(0, 32)
|
||||
var derivedHalf2 = scryptBuf.slice(32, 64)
|
||||
|
||||
var privKeyBuf = buffer.slice(7, 7 + 32)
|
||||
var decipher = aes.createDecipheriv('aes-256-ecb', derivedHalf2, NULL)
|
||||
decipher.setAutoPadding(false)
|
||||
decipher.end(privKeyBuf)
|
||||
|
||||
var plainText = decipher.read()
|
||||
var privateKey = xor(derivedHalf1, plainText)
|
||||
|
||||
// verify salt matches address
|
||||
var d = BigInteger.fromBuffer(privateKey)
|
||||
var address = getAddress(d, compressed)
|
||||
var checksum = hash256(address).slice(0, 4)
|
||||
assert.deepStrictEqual(salt, checksum)
|
||||
|
||||
return {
|
||||
privateKey: privateKey,
|
||||
compressed: compressed
|
||||
}
|
||||
}
|
||||
|
||||
function decrypt (string, passphrase, progressCallback, scryptParams) {
|
||||
return decryptRaw(bs58check.decode(string), passphrase, progressCallback, scryptParams)
|
||||
}
|
||||
|
||||
function decryptECMult (buffer, passphrase, progressCallback, scryptParams) {
|
||||
passphrase = Buffer.from(passphrase, 'utf8')
|
||||
buffer = buffer.slice(1) // FIXME: we can avoid this
|
||||
scryptParams = scryptParams || SCRYPT_PARAMS
|
||||
|
||||
var flag = buffer.readUInt8(1)
|
||||
var compressed = (flag & 0x20) !== 0
|
||||
var hasLotSeq = (flag & 0x04) !== 0
|
||||
|
||||
assert.strictEqual((flag & 0x24), flag, 'Invalid private key.')
|
||||
|
||||
var addressHash = buffer.slice(2, 6)
|
||||
var ownerEntropy = buffer.slice(6, 14)
|
||||
var ownerSalt
|
||||
|
||||
// 4 bytes ownerSalt if 4 bytes lot/sequence
|
||||
if (hasLotSeq) {
|
||||
ownerSalt = ownerEntropy.slice(0, 4)
|
||||
|
||||
// else, 8 bytes ownerSalt
|
||||
} else {
|
||||
ownerSalt = ownerEntropy
|
||||
}
|
||||
|
||||
var encryptedPart1 = buffer.slice(14, 22) // First 8 bytes
|
||||
var encryptedPart2 = buffer.slice(22, 38) // 16 bytes
|
||||
|
||||
var N = scryptParams.N
|
||||
var r = scryptParams.r
|
||||
var p = scryptParams.p
|
||||
var preFactor = scrypt(passphrase, ownerSalt, N, r, p, 32, progressCallback)
|
||||
|
||||
var passFactor
|
||||
if (hasLotSeq) {
|
||||
var hashTarget = Buffer.concat([preFactor, ownerEntropy])
|
||||
passFactor = hash256(hashTarget)
|
||||
} else {
|
||||
passFactor = preFactor
|
||||
}
|
||||
|
||||
var passInt = BigInteger.fromBuffer(passFactor)
|
||||
var passPoint = curve.G.multiply(passInt).getEncoded(true)
|
||||
|
||||
var seedBPass = scrypt(passPoint, Buffer.concat([addressHash, ownerEntropy]), 1024, 1, 1, 64)
|
||||
var derivedHalf1 = seedBPass.slice(0, 32)
|
||||
var derivedHalf2 = seedBPass.slice(32, 64)
|
||||
|
||||
var decipher = aes.createDecipheriv('aes-256-ecb', derivedHalf2, Buffer.alloc(0))
|
||||
decipher.setAutoPadding(false)
|
||||
decipher.end(encryptedPart2)
|
||||
|
||||
var decryptedPart2 = decipher.read()
|
||||
var tmp = xor(decryptedPart2, derivedHalf1.slice(16, 32))
|
||||
var seedBPart2 = tmp.slice(8, 16)
|
||||
|
||||
var decipher2 = aes.createDecipheriv('aes-256-ecb', derivedHalf2, Buffer.alloc(0))
|
||||
decipher2.setAutoPadding(false)
|
||||
decipher2.write(encryptedPart1) // first 8 bytes
|
||||
decipher2.end(tmp.slice(0, 8)) // last 8 bytes
|
||||
|
||||
var seedBPart1 = xor(decipher2.read(), derivedHalf1.slice(0, 16))
|
||||
var seedB = Buffer.concat([seedBPart1, seedBPart2], 24)
|
||||
var factorB = BigInteger.fromBuffer(hash256(seedB))
|
||||
|
||||
// d = passFactor * factorB (mod n)
|
||||
var d = passInt.multiply(factorB).mod(curve.n)
|
||||
|
||||
return {
|
||||
privateKey: d.toBuffer(32),
|
||||
compressed: compressed
|
||||
}
|
||||
}
|
||||
|
||||
function verify (string) {
|
||||
var decoded = bs58check.decodeUnsafe(string)
|
||||
if (!decoded) return false
|
||||
|
||||
if (decoded.length !== 39) return false
|
||||
if (decoded.readUInt8(0) !== 0x01) return false
|
||||
|
||||
var type = decoded.readUInt8(1)
|
||||
var flag = decoded.readUInt8(2)
|
||||
|
||||
// encrypted WIF
|
||||
if (type === 0x42) {
|
||||
if (flag !== 0xc0 && flag !== 0xe0) return false
|
||||
|
||||
// EC mult
|
||||
} else if (type === 0x43) {
|
||||
if ((flag & ~0x24)) return false
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
decrypt: decrypt,
|
||||
decryptECMult: decryptECMult,
|
||||
decryptRaw: decryptRaw,
|
||||
encrypt: encrypt,
|
||||
encryptRaw: encryptRaw,
|
||||
verify: verify
|
||||
}
|
||||
38
libs/bitcoinjs-bip38/package.json
Normal file
38
libs/bitcoinjs-bip38/package.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "bip38",
|
||||
"version": "2.0.2",
|
||||
"description": "BIP38 is a standard process to encrypt Bitcoin and crypto currency private keys that is impervious to brute force attacks thus protecting the user.",
|
||||
"main": "index.js",
|
||||
"keywords": [
|
||||
"bitcoin",
|
||||
"crypto",
|
||||
"cryptography",
|
||||
"litecoin"
|
||||
],
|
||||
"homepage": "http://cryptocoinjs.com/modules/currency/bip38/",
|
||||
"author": "JP Richardson",
|
||||
"dependencies": {
|
||||
"bigi": "^1.2.0",
|
||||
"browserify-aes": "^1.0.1",
|
||||
"bs58check": "<3.0.0",
|
||||
"buffer-xor": "^1.0.2",
|
||||
"create-hash": "^1.1.1",
|
||||
"ecurve": "^1.0.0",
|
||||
"scryptsy": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
},
|
||||
"repository": {
|
||||
"url": "git@github.com:bitcoinjs/bip38.git",
|
||||
"type": "git"
|
||||
},
|
||||
"scripts": {
|
||||
"browser-test": "mochify --wd -R spec --timeout 100000",
|
||||
"build": "browserify index.js --standalone bitcoinjs-bip38 > /tmp/bitcoinjs-bip38.js",
|
||||
"coverage": "istanbul cover _mocha -- --reporter list test/*.js",
|
||||
"coveralls": "npm run-script coverage && coveralls < coverage/lcov.info",
|
||||
"standard": "standard",
|
||||
"test": "npm run standard && npm run unit",
|
||||
"unit": "mocha --ui bdd --timeout 240000"
|
||||
}
|
||||
}
|
||||
4
libs/bitcoinjs-bip38/readme.md
Normal file
4
libs/bitcoinjs-bip38/readme.md
Normal file
@@ -0,0 +1,4 @@
|
||||
Build (will create a bundle and copy it to /tmp/bitcoinjs-bip38.js):
|
||||
|
||||
npm install
|
||||
npm run build
|
||||
5
libs/bitcoinjs-lib/bitcoinjs-lib.js
Normal file
5
libs/bitcoinjs-lib/bitcoinjs-lib.js
Normal file
@@ -0,0 +1,5 @@
|
||||
let bitcoin = require('bitcoinjs-lib')
|
||||
|
||||
module.exports = {
|
||||
bitcoin
|
||||
}
|
||||
14
libs/bitcoinjs-lib/package.json
Normal file
14
libs/bitcoinjs-lib/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "bitcoinjs-lib",
|
||||
"version": "3.3.2",
|
||||
"scripts": {
|
||||
"build": "browserify bitcoinjs-lib.js --standalone bitcoinjs > /tmp/bitcoinjs-lib.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"bitcoinjs-lib": "3.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^16.2.3",
|
||||
"uglify-es": "^3.3.9"
|
||||
}
|
||||
}
|
||||
5
libs/bitcoinjs-lib/readme.md
Normal file
5
libs/bitcoinjs-lib/readme.md
Normal file
@@ -0,0 +1,5 @@
|
||||
Build (will create a bundle and copy it to /tmp/bitcoinjs-lib.js):
|
||||
|
||||
npm install
|
||||
npm run build
|
||||
manually add changes in https://github.com/iancoleman/bip39/commit/0702ecd3520c44cb8016f80329dcb5a3c8df88fc
|
||||
169
libs/combined/index.js
Normal file
169
libs/combined/index.js
Normal file
@@ -0,0 +1,169 @@
|
||||
/* base-x */
|
||||
|
||||
module.exports.basex = require('base-x')
|
||||
|
||||
/* base32 */
|
||||
|
||||
module.exports.base32 = require('base32.js')
|
||||
|
||||
/* bchaddrjs */
|
||||
|
||||
module.exports.bchaddr = require('bchaddrjs')
|
||||
|
||||
/* bchaddrjs slp */
|
||||
|
||||
module.exports.bchaddrSlp = require('bchaddrjs-slp')
|
||||
|
||||
/* bech32 */
|
||||
|
||||
module.exports.bech32 = require('bech32')
|
||||
|
||||
/* biginteger */
|
||||
|
||||
module.exports.BigInteger = require('javascript-biginteger')
|
||||
|
||||
/* bitcoinjs-bip38 */
|
||||
|
||||
module.exports.bip38 = require('bip38')
|
||||
|
||||
/* bip85 */
|
||||
|
||||
module.exports.bip85 = require('bip85')
|
||||
|
||||
/* bitcoinjs-lib */
|
||||
|
||||
module.exports.bitcoin = require('bitcoinjs-lib')
|
||||
|
||||
/* buffer */
|
||||
|
||||
module.exports.buffer = require('buffer');
|
||||
|
||||
/* elastos */
|
||||
// See https://github.com/iancoleman/bip39/pull/368
|
||||
// and https://github.com/johnnynanjiang/Elastos.SDK.Keypair.Javascript/tree/iancoleman-bip39
|
||||
|
||||
module.exports.elastosjs = require('elastos-wallet-js')
|
||||
|
||||
/* ethereum-util */
|
||||
|
||||
module.exports.ethUtil = require('ethereumjs-util')
|
||||
|
||||
/* fast-levenshtein */
|
||||
|
||||
module.exports.levenshtein = require('fast-levenshtein')
|
||||
|
||||
/* groestlcoin */
|
||||
|
||||
module.exports.groestlcoinjs = require('groestlcoinjs-lib')
|
||||
|
||||
/* groestlcoin bip38 */
|
||||
|
||||
module.exports.groestlcoinjsBip38 = require('bip38grs')
|
||||
|
||||
/* kjua qr codes */
|
||||
|
||||
module.exports.kjua = require('kjua')
|
||||
|
||||
/* nebulas */
|
||||
|
||||
try {
|
||||
module.exports.nebulas = require('nebulas')
|
||||
}
|
||||
catch (e) {
|
||||
console.warn("Error loading nebulas library");
|
||||
console.warn(e);
|
||||
};
|
||||
|
||||
/* stellar-util */
|
||||
|
||||
let StellarBase = require('stellar-base');
|
||||
let edHd = require('ed25519-hd-key');
|
||||
module.exports.stellarUtil = {
|
||||
getKeypair: function (path, seed) {
|
||||
const result = edHd.derivePath(path, seed);
|
||||
return StellarBase.Keypair.fromRawEd25519Seed(result.key);
|
||||
},
|
||||
dummyNetwork: {
|
||||
bip32: {public: 0, private: 0},
|
||||
messagePrefix: '',
|
||||
pubKeyHash: 0,
|
||||
scriptHash: 0,
|
||||
wif: 0,
|
||||
},
|
||||
}
|
||||
|
||||
/* zoobc-util */
|
||||
|
||||
let base32 = require('base32.js');
|
||||
let nbl = require('nebulas');
|
||||
module.exports.zoobcUtil = {
|
||||
getKeypair: function (path, seed) {
|
||||
const { key, chainCode} = edHd.derivePath(path, seed);
|
||||
const pubKey = edHd.getPublicKey(key);
|
||||
return {key,chainCode, pubKey};
|
||||
},
|
||||
getZBCAddress(publicKey, prefix = "ZBC") {
|
||||
const prefixDefault = ["ZBC", "ZNK", "ZBL", "ZTX"];
|
||||
const valid = prefixDefault.indexOf(prefix) > -1;
|
||||
if (valid) {
|
||||
var bytes = new Uint8Array(35);
|
||||
for (let i = 0; i < 32; i++) bytes[i] = publicKey[i];
|
||||
for (let i = 0; i < 3; i++) bytes[i + 32] = prefix.charCodeAt(i);
|
||||
const checksum = nbl.CryptoUtils.sha3(bytes);
|
||||
for (let i = 0; i < 3; i++) bytes[i + 32] = Number(checksum[i]);
|
||||
var segs = [prefix];
|
||||
var b32 = base32.encode(bytes);
|
||||
for (let i = 0; i < 7; i++) segs.push(b32.substr(i * 8, 8));
|
||||
return segs.join("_");
|
||||
} else {
|
||||
throw new Error("The Prefix not available!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* nano-util */
|
||||
|
||||
let NanoBase = require('nanocurrency-web');
|
||||
module.exports.nanoUtil = {
|
||||
getKeypair: function (index, seed) {
|
||||
const accounts = NanoBase.wallet.accounts(seed, index, index)
|
||||
return {privKey: accounts[0].privateKey, pubKey: accounts[0].publicKey, address: accounts[0].address};
|
||||
},
|
||||
dummyNetwork: {
|
||||
bip32: {public: 0, private: 0},
|
||||
messagePrefix: '',
|
||||
pubKeyHash: 0,
|
||||
scriptHash: 0,
|
||||
wif: 0,
|
||||
},
|
||||
}
|
||||
|
||||
/* unorm */
|
||||
|
||||
module.exports.unorm = require('unorm')
|
||||
|
||||
/* zxcvbn */
|
||||
|
||||
module.exports.zxcvbn = require('zxcvbn')
|
||||
|
||||
/* handshake */
|
||||
module.exports.handshake = require('handshake-util')
|
||||
|
||||
/* bs58 */
|
||||
try {
|
||||
module.exports.bs58 = require('bs58')
|
||||
}
|
||||
catch (e) {
|
||||
console.warn("Error loading bs58 library");
|
||||
console.warn(e);
|
||||
};
|
||||
|
||||
/* create-hash */
|
||||
try {
|
||||
module.exports.createHash = require('create-hash')
|
||||
}
|
||||
catch (e) {
|
||||
console.warn("Error loading create-hash library");
|
||||
console.warn(e);
|
||||
};
|
||||
|
||||
5314
libs/combined/package-lock.json
generated
Normal file
5314
libs/combined/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
38
libs/combined/package.json
Normal file
38
libs/combined/package.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "bip39-tool-external-libs",
|
||||
"version": "0.4.0",
|
||||
"scripts": {
|
||||
"build": "browserify index.js --standalone libs | uglifyjs -c > ../../src/js/bip39-libs.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"base-x": "3.0.7",
|
||||
"bchaddrjs": "0.4.4",
|
||||
"bchaddrjs-slp": "git://github.com/simpleledger/bchaddrjs.git#af16e44a6bfbe4b3980a62dba50e2f68ed864c6b",
|
||||
"bech32": "1.1.4",
|
||||
"bip38": "2.0.2",
|
||||
"bip38grs": "git://github.com/Groestlcoin/bip38grs.git#091975b01679b74dc0a4136bb743fe17791b0151",
|
||||
"bip85": "0.0.3",
|
||||
"bitcoinjs-lib": "git://github.com/iancoleman/bitcoinjs-lib.git#v3.3.2_16bit",
|
||||
"bs58": "^4.0.1",
|
||||
"buffer": "^5.4.3",
|
||||
"create-hash": "^1.2.0",
|
||||
"ed25519-hd-key": "^1.0.0",
|
||||
"elastos-wallet-js": "git://github.com/johnnynanjiang/Elastos.SDK.Keypair.Javascript.git#491dc51b64efaf0a8aae62028b68e2c8e38fde06",
|
||||
"ethereumjs-util": "6.0.0",
|
||||
"fast-levenshtein": "2.0.6",
|
||||
"groestlcoinjs-lib": "git://github.com/Groestlcoin/groestlcoinjs-lib.git#3.3.2",
|
||||
"handshake-util": "1.2.0",
|
||||
"javascript-biginteger": "0.9.2",
|
||||
"jsrsasign": "^8.0.19",
|
||||
"kjua": "0.6.0",
|
||||
"nanocurrency-web": "^1.2.2",
|
||||
"nebulas": "0.5.6",
|
||||
"stellar-base": "^0.10.0",
|
||||
"unorm": "1.6.0",
|
||||
"zxcvbn": "4.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^16.2.3",
|
||||
"uglify-es": "^3.3.9"
|
||||
}
|
||||
}
|
||||
6
libs/combined/readme.md
Normal file
6
libs/combined/readme.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Generate libs
|
||||
|
||||
```
|
||||
npm install --no-optional
|
||||
npm run build
|
||||
```
|
||||
736
libs/ethereumjs-util/index.js
Normal file
736
libs/ethereumjs-util/index.js
Normal file
@@ -0,0 +1,736 @@
|
||||
const createKeccakHash = require('keccak')
|
||||
const secp256k1 = require('secp256k1')
|
||||
const assert = require('assert')
|
||||
const rlp = require('rlp')
|
||||
const BN = require('bn.js')
|
||||
const createHash = require('create-hash')
|
||||
const Buffer = require('safe-buffer').Buffer
|
||||
Object.assign(exports, require('ethjs-util'))
|
||||
|
||||
/**
|
||||
* the max integer that this VM can handle (a ```BN```)
|
||||
* @var {BN} MAX_INTEGER
|
||||
*/
|
||||
exports.MAX_INTEGER = new BN('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', 16)
|
||||
|
||||
/**
|
||||
* 2^256 (a ```BN```)
|
||||
* @var {BN} TWO_POW256
|
||||
*/
|
||||
exports.TWO_POW256 = new BN('10000000000000000000000000000000000000000000000000000000000000000', 16)
|
||||
|
||||
/**
|
||||
* Keccak-256 hash of null (a ```String```)
|
||||
* @var {String} KECCAK256_NULL_S
|
||||
*/
|
||||
exports.KECCAK256_NULL_S = 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'
|
||||
|
||||
/**
|
||||
* Keccak-256 hash of null (a ```Buffer```)
|
||||
* @var {Buffer} KECCAK256_NULL
|
||||
*/
|
||||
exports.KECCAK256_NULL = Buffer.from(exports.KECCAK256_NULL_S, 'hex')
|
||||
|
||||
/**
|
||||
* Keccak-256 of an RLP of an empty array (a ```String```)
|
||||
* @var {String} KECCAK256_RLP_ARRAY_S
|
||||
*/
|
||||
exports.KECCAK256_RLP_ARRAY_S = '1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347'
|
||||
|
||||
/**
|
||||
* Keccak-256 of an RLP of an empty array (a ```Buffer```)
|
||||
* @var {Buffer} KECCAK256_RLP_ARRAY
|
||||
*/
|
||||
exports.KECCAK256_RLP_ARRAY = Buffer.from(exports.KECCAK256_RLP_ARRAY_S, 'hex')
|
||||
|
||||
/**
|
||||
* Keccak-256 hash of the RLP of null (a ```String```)
|
||||
* @var {String} KECCAK256_RLP_S
|
||||
*/
|
||||
exports.KECCAK256_RLP_S = '56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
|
||||
|
||||
/**
|
||||
* Keccak-256 hash of the RLP of null (a ```Buffer```)
|
||||
* @var {Buffer} KECCAK256_RLP
|
||||
*/
|
||||
exports.KECCAK256_RLP = Buffer.from(exports.KECCAK256_RLP_S, 'hex')
|
||||
|
||||
/**
|
||||
* [`BN`](https://github.com/indutny/bn.js)
|
||||
* @var {Function}
|
||||
*/
|
||||
exports.BN = BN
|
||||
|
||||
/**
|
||||
* [`rlp`](https://github.com/ethereumjs/rlp)
|
||||
* @var {Function}
|
||||
*/
|
||||
exports.rlp = rlp
|
||||
|
||||
/**
|
||||
* [`secp256k1`](https://github.com/cryptocoinjs/secp256k1-node/)
|
||||
* @var {Object}
|
||||
*/
|
||||
exports.secp256k1 = secp256k1
|
||||
|
||||
/**
|
||||
* Returns a buffer filled with 0s
|
||||
* @method zeros
|
||||
* @param {Number} bytes the number of bytes the buffer should be
|
||||
* @return {Buffer}
|
||||
*/
|
||||
exports.zeros = function (bytes) {
|
||||
return Buffer.allocUnsafe(bytes).fill(0)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a zero address
|
||||
* @method zeroAddress
|
||||
* @return {String}
|
||||
*/
|
||||
exports.zeroAddress = function () {
|
||||
const addressLength = 20
|
||||
const zeroAddress = exports.zeros(addressLength)
|
||||
return exports.bufferToHex(zeroAddress)
|
||||
}
|
||||
|
||||
/**
|
||||
* Left Pads an `Array` or `Buffer` with leading zeros till it has `length` bytes.
|
||||
* Or it truncates the beginning if it exceeds.
|
||||
* @method lsetLength
|
||||
* @param {Buffer|Array} msg the value to pad
|
||||
* @param {Number} length the number of bytes the output should be
|
||||
* @param {Boolean} [right=false] whether to start padding form the left or right
|
||||
* @return {Buffer|Array}
|
||||
*/
|
||||
exports.setLengthLeft = exports.setLength = function (msg, length, right) {
|
||||
const buf = exports.zeros(length)
|
||||
msg = exports.toBuffer(msg)
|
||||
if (right) {
|
||||
if (msg.length < length) {
|
||||
msg.copy(buf)
|
||||
return buf
|
||||
}
|
||||
return msg.slice(0, length)
|
||||
} else {
|
||||
if (msg.length < length) {
|
||||
msg.copy(buf, length - msg.length)
|
||||
return buf
|
||||
}
|
||||
return msg.slice(-length)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Right Pads an `Array` or `Buffer` with leading zeros till it has `length` bytes.
|
||||
* Or it truncates the beginning if it exceeds.
|
||||
* @param {Buffer|Array} msg the value to pad
|
||||
* @param {Number} length the number of bytes the output should be
|
||||
* @return {Buffer|Array}
|
||||
*/
|
||||
exports.setLengthRight = function (msg, length) {
|
||||
return exports.setLength(msg, length, true)
|
||||
}
|
||||
|
||||
/**
|
||||
* Trims leading zeros from a `Buffer` or an `Array`
|
||||
* @param {Buffer|Array|String} a
|
||||
* @return {Buffer|Array|String}
|
||||
*/
|
||||
exports.unpad = exports.stripZeros = function (a) {
|
||||
a = exports.stripHexPrefix(a)
|
||||
let first = a[0]
|
||||
while (a.length > 0 && first.toString() === '0') {
|
||||
a = a.slice(1)
|
||||
first = a[0]
|
||||
}
|
||||
return a
|
||||
}
|
||||
/**
|
||||
* Attempts to turn a value into a `Buffer`. As input it supports `Buffer`, `String`, `Number`, null/undefined, `BN` and other objects with a `toArray()` method.
|
||||
* @param {*} v the value
|
||||
*/
|
||||
exports.toBuffer = function (v) {
|
||||
if (!Buffer.isBuffer(v)) {
|
||||
if (Array.isArray(v)) {
|
||||
v = Buffer.from(v)
|
||||
} else if (typeof v === 'string') {
|
||||
if (exports.isHexString(v)) {
|
||||
v = Buffer.from(exports.padToEven(exports.stripHexPrefix(v)), 'hex')
|
||||
} else {
|
||||
v = Buffer.from(v)
|
||||
}
|
||||
} else if (typeof v === 'number') {
|
||||
v = exports.intToBuffer(v)
|
||||
} else if (v === null || v === undefined) {
|
||||
v = Buffer.allocUnsafe(0)
|
||||
} else if (BN.isBN(v)) {
|
||||
v = v.toArrayLike(Buffer)
|
||||
} else if (v.toArray) {
|
||||
// converts a BN to a Buffer
|
||||
v = Buffer.from(v.toArray())
|
||||
} else {
|
||||
throw new Error('invalid type')
|
||||
}
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a `Buffer` to a `Number`
|
||||
* @param {Buffer} buf
|
||||
* @return {Number}
|
||||
* @throws If the input number exceeds 53 bits.
|
||||
*/
|
||||
exports.bufferToInt = function (buf) {
|
||||
return new BN(exports.toBuffer(buf)).toNumber()
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a `Buffer` into a hex `String`
|
||||
* @param {Buffer} buf
|
||||
* @return {String}
|
||||
*/
|
||||
exports.bufferToHex = function (buf) {
|
||||
buf = exports.toBuffer(buf)
|
||||
return '0x' + buf.toString('hex')
|
||||
}
|
||||
|
||||
/**
|
||||
* Interprets a `Buffer` as a signed integer and returns a `BN`. Assumes 256-bit numbers.
|
||||
* @param {Buffer} num
|
||||
* @return {BN}
|
||||
*/
|
||||
exports.fromSigned = function (num) {
|
||||
return new BN(num).fromTwos(256)
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a `BN` to an unsigned integer and returns it as a `Buffer`. Assumes 256-bit numbers.
|
||||
* @param {BN} num
|
||||
* @return {Buffer}
|
||||
*/
|
||||
exports.toUnsigned = function (num) {
|
||||
return Buffer.from(num.toTwos(256).toArray())
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates Keccak hash of the input
|
||||
* @param {Buffer|Array|String|Number} a the input data
|
||||
* @param {Number} [bits=256] the Keccak width
|
||||
* @return {Buffer}
|
||||
*/
|
||||
exports.keccak = function (a, bits) {
|
||||
a = exports.toBuffer(a)
|
||||
if (!bits) bits = 256
|
||||
|
||||
return createKeccakHash('keccak' + bits).update(a).digest()
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates Keccak-256 hash of the input, alias for keccak(a, 256)
|
||||
* @param {Buffer|Array|String|Number} a the input data
|
||||
* @return {Buffer}
|
||||
*/
|
||||
exports.keccak256 = function (a) {
|
||||
return exports.keccak(a)
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates SHA256 hash of the input
|
||||
* @param {Buffer|Array|String|Number} a the input data
|
||||
* @return {Buffer}
|
||||
*/
|
||||
exports.sha256 = function (a) {
|
||||
a = exports.toBuffer(a)
|
||||
return createHash('sha256').update(a).digest()
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates RIPEMD160 hash of the input
|
||||
* @param {Buffer|Array|String|Number} a the input data
|
||||
* @param {Boolean} padded whether it should be padded to 256 bits or not
|
||||
* @return {Buffer}
|
||||
*/
|
||||
exports.ripemd160 = function (a, padded) {
|
||||
a = exports.toBuffer(a)
|
||||
const hash = createHash('rmd160').update(a).digest()
|
||||
if (padded === true) {
|
||||
return exports.setLength(hash, 32)
|
||||
} else {
|
||||
return hash
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates SHA-3 hash of the RLP encoded version of the input
|
||||
* @param {Buffer|Array|String|Number} a the input data
|
||||
* @return {Buffer}
|
||||
*/
|
||||
exports.rlphash = function (a) {
|
||||
return exports.keccak(rlp.encode(a))
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the private key satisfies the rules of the curve secp256k1.
|
||||
* @param {Buffer} privateKey
|
||||
* @return {Boolean}
|
||||
*/
|
||||
exports.isValidPrivate = function (privateKey) {
|
||||
return secp256k1.privateKeyVerify(privateKey)
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the public key satisfies the rules of the curve secp256k1
|
||||
* and the requirements of Ethereum.
|
||||
* @param {Buffer} publicKey The two points of an uncompressed key, unless sanitize is enabled
|
||||
* @param {Boolean} [sanitize=false] Accept public keys in other formats
|
||||
* @return {Boolean}
|
||||
*/
|
||||
exports.isValidPublic = function (publicKey, sanitize) {
|
||||
if (publicKey.length === 64) {
|
||||
// Convert to SEC1 for secp256k1
|
||||
return secp256k1.publicKeyVerify(Buffer.concat([ Buffer.from([4]), publicKey ]))
|
||||
}
|
||||
|
||||
if (!sanitize) {
|
||||
return false
|
||||
}
|
||||
|
||||
return secp256k1.publicKeyVerify(publicKey)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ethereum address of a given public key.
|
||||
* Accepts "Ethereum public keys" and SEC1 encoded keys.
|
||||
* @param {Buffer} pubKey The two points of an uncompressed key, unless sanitize is enabled
|
||||
* @param {Boolean} [sanitize=false] Accept public keys in other formats
|
||||
* @return {Buffer}
|
||||
*/
|
||||
exports.pubToAddress = exports.publicToAddress = function (pubKey, sanitize) {
|
||||
pubKey = exports.toBuffer(pubKey)
|
||||
if (sanitize && (pubKey.length !== 64)) {
|
||||
pubKey = secp256k1.publicKeyConvert(pubKey, false).slice(1)
|
||||
}
|
||||
assert(pubKey.length === 64)
|
||||
// Only take the lower 160bits of the hash
|
||||
return exports.keccak(pubKey).slice(-20)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ethereum public key of a given private key
|
||||
* @param {Buffer} privateKey A private key must be 256 bits wide
|
||||
* @return {Buffer}
|
||||
*/
|
||||
const privateToPublic = exports.privateToPublic = function (privateKey) {
|
||||
privateKey = exports.toBuffer(privateKey)
|
||||
// skip the type flag and use the X, Y points
|
||||
return secp256k1.publicKeyCreate(privateKey, false).slice(1)
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a public key to the Ethereum format.
|
||||
* @param {Buffer} publicKey
|
||||
* @return {Buffer}
|
||||
*/
|
||||
exports.importPublic = function (publicKey) {
|
||||
publicKey = exports.toBuffer(publicKey)
|
||||
if (publicKey.length !== 64) {
|
||||
publicKey = secp256k1.publicKeyConvert(publicKey, false).slice(1)
|
||||
}
|
||||
return publicKey
|
||||
}
|
||||
|
||||
/**
|
||||
* ECDSA sign
|
||||
* @param {Buffer} msgHash
|
||||
* @param {Buffer} privateKey
|
||||
* @param {Number} [chainId]
|
||||
* @return {Object}
|
||||
*/
|
||||
exports.ecsign = function (msgHash, privateKey, chainId) {
|
||||
const sig = secp256k1.sign(msgHash, privateKey)
|
||||
|
||||
const ret = {}
|
||||
ret.r = sig.signature.slice(0, 32)
|
||||
ret.s = sig.signature.slice(32, 64)
|
||||
ret.v = chainId ? sig.recovery + (chainId * 2 + 35) : sig.recovery + 27
|
||||
return ret
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the keccak-256 hash of `message`, prefixed with the header used by the `eth_sign` RPC call.
|
||||
* The output of this function can be fed into `ecsign` to produce the same signature as the `eth_sign`
|
||||
* call for a given `message`, or fed to `ecrecover` along with a signature to recover the public key
|
||||
* used to produce the signature.
|
||||
* @param message
|
||||
* @returns {Buffer} hash
|
||||
*/
|
||||
exports.hashPersonalMessage = function (message) {
|
||||
const prefix = exports.toBuffer('\u0019Ethereum Signed Message:\n' + message.length.toString())
|
||||
return exports.keccak(Buffer.concat([prefix, message]))
|
||||
}
|
||||
|
||||
/**
|
||||
* ECDSA public key recovery from signature
|
||||
* @param {Buffer} msgHash
|
||||
* @param {Number} v
|
||||
* @param {Buffer} r
|
||||
* @param {Buffer} s
|
||||
* @param {Number} [chainId]
|
||||
* @return {Buffer} publicKey
|
||||
*/
|
||||
exports.ecrecover = function (msgHash, v, r, s, chainId) {
|
||||
const signature = Buffer.concat([exports.setLength(r, 32), exports.setLength(s, 32)], 64)
|
||||
const recovery = calculateSigRecovery(v, chainId)
|
||||
if (!isValidSigRecovery(recovery)) {
|
||||
throw new Error('Invalid signature v value')
|
||||
}
|
||||
const senderPubKey = secp256k1.recover(msgHash, signature, recovery)
|
||||
return secp256k1.publicKeyConvert(senderPubKey, false).slice(1)
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert signature parameters into the format of `eth_sign` RPC method
|
||||
* @param {Number} v
|
||||
* @param {Buffer} r
|
||||
* @param {Buffer} s
|
||||
* @param {Number} [chainId]
|
||||
* @return {String} sig
|
||||
*/
|
||||
exports.toRpcSig = function (v, r, s, chainId) {
|
||||
let recovery = calculateSigRecovery(v, chainId)
|
||||
if (!isValidSigRecovery(recovery)) {
|
||||
throw new Error('Invalid signature v value')
|
||||
}
|
||||
|
||||
// geth (and the RPC eth_sign method) uses the 65 byte format used by Bitcoin
|
||||
return exports.bufferToHex(Buffer.concat([
|
||||
exports.setLengthLeft(r, 32),
|
||||
exports.setLengthLeft(s, 32),
|
||||
exports.toBuffer(v)
|
||||
]))
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert signature format of the `eth_sign` RPC method to signature parameters
|
||||
* NOTE: all because of a bug in geth: https://github.com/ethereum/go-ethereum/issues/2053
|
||||
* @param {String} sig
|
||||
* @return {Object}
|
||||
*/
|
||||
exports.fromRpcSig = function (sig) {
|
||||
sig = exports.toBuffer(sig)
|
||||
|
||||
// NOTE: with potential introduction of chainId this might need to be updated
|
||||
if (sig.length !== 65) {
|
||||
throw new Error('Invalid signature length')
|
||||
}
|
||||
|
||||
let v = sig[64]
|
||||
// support both versions of `eth_sign` responses
|
||||
if (v < 27) {
|
||||
v += 27
|
||||
}
|
||||
|
||||
return {
|
||||
v: v,
|
||||
r: sig.slice(0, 32),
|
||||
s: sig.slice(32, 64)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ethereum address of a given private key
|
||||
* @param {Buffer} privateKey A private key must be 256 bits wide
|
||||
* @return {Buffer}
|
||||
*/
|
||||
exports.privateToAddress = function (privateKey) {
|
||||
return exports.publicToAddress(privateToPublic(privateKey))
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the address is a valid. Accepts checksummed addresses too
|
||||
* @param {String} address
|
||||
* @return {Boolean}
|
||||
*/
|
||||
exports.isValidAddress = function (address) {
|
||||
return /^0x[0-9a-fA-F]{40}$/.test(address)
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a given address is a zero address
|
||||
* @method isZeroAddress
|
||||
* @param {String} address
|
||||
* @return {Boolean}
|
||||
*/
|
||||
exports.isZeroAddress = function (address) {
|
||||
const zeroAddress = exports.zeroAddress()
|
||||
return zeroAddress === exports.addHexPrefix(address)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a checksummed address
|
||||
* @param {String} address
|
||||
* @return {String}
|
||||
*/
|
||||
exports.toChecksumAddress = function (address) {
|
||||
address = exports.stripHexPrefix(address).toLowerCase()
|
||||
const hash = exports.keccak(address).toString('hex')
|
||||
let ret = '0x'
|
||||
|
||||
for (let i = 0; i < address.length; i++) {
|
||||
if (parseInt(hash[i], 16) >= 8) {
|
||||
ret += address[i].toUpperCase()
|
||||
} else {
|
||||
ret += address[i]
|
||||
}
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the address is a valid checksummed address
|
||||
* @param {Buffer} address
|
||||
* @return {Boolean}
|
||||
*/
|
||||
exports.isValidChecksumAddress = function (address) {
|
||||
return exports.isValidAddress(address) && (exports.toChecksumAddress(address) === address)
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates an address of a newly created contract
|
||||
* @param {Buffer} from the address which is creating this new address
|
||||
* @param {Buffer} nonce the nonce of the from account
|
||||
* @return {Buffer}
|
||||
*/
|
||||
exports.generateAddress = function (from, nonce) {
|
||||
from = exports.toBuffer(from)
|
||||
nonce = new BN(nonce)
|
||||
|
||||
if (nonce.isZero()) {
|
||||
// in RLP we want to encode null in the case of zero nonce
|
||||
// read the RLP documentation for an answer if you dare
|
||||
nonce = null
|
||||
} else {
|
||||
nonce = Buffer.from(nonce.toArray())
|
||||
}
|
||||
|
||||
// Only take the lower 160bits of the hash
|
||||
return exports.rlphash([from, nonce]).slice(-20)
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates an address for a contract created using CREATE2
|
||||
* @param {Buffer} from the address which is creating this new address
|
||||
* @param {Buffer} salt a salt
|
||||
* @param {Buffer} initCode the init code of the contract being created
|
||||
* @return {Buffer}
|
||||
*/
|
||||
exports.generateAddress2 = function (from, salt, initCode) {
|
||||
from = exports.toBuffer(from)
|
||||
salt = exports.toBuffer(salt)
|
||||
initCode = exports.toBuffer(initCode)
|
||||
|
||||
assert(from.length === 20)
|
||||
assert(salt.length === 32)
|
||||
|
||||
let address = exports.keccak256(Buffer.concat([
|
||||
Buffer.from('ff', 'hex'),
|
||||
from,
|
||||
salt,
|
||||
exports.keccak256(initCode)
|
||||
]))
|
||||
|
||||
return address.slice(-20)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the supplied address belongs to a precompiled account (Byzantium)
|
||||
* @param {Buffer|String} address
|
||||
* @return {Boolean}
|
||||
*/
|
||||
exports.isPrecompiled = function (address) {
|
||||
const a = exports.unpad(address)
|
||||
return a.length === 1 && a[0] >= 1 && a[0] <= 8
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds "0x" to a given `String` if it does not already start with "0x"
|
||||
* @param {String} str
|
||||
* @return {String}
|
||||
*/
|
||||
exports.addHexPrefix = function (str) {
|
||||
if (typeof str !== 'string') {
|
||||
return str
|
||||
}
|
||||
|
||||
return exports.isHexPrefixed(str) ? str : '0x' + str
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate ECDSA signature
|
||||
* @method isValidSignature
|
||||
* @param {Buffer} v
|
||||
* @param {Buffer} r
|
||||
* @param {Buffer} s
|
||||
* @param {Boolean} [homestead=true]
|
||||
* @param {Number} [chainId]
|
||||
* @return {Boolean}
|
||||
*/
|
||||
|
||||
exports.isValidSignature = function (v, r, s, homestead, chainId) {
|
||||
const SECP256K1_N_DIV_2 = new BN('7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0', 16)
|
||||
const SECP256K1_N = new BN('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141', 16)
|
||||
|
||||
if (r.length !== 32 || s.length !== 32) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (!isValidSigRecovery(calculateSigRecovery(v, chainId))) {
|
||||
return false
|
||||
}
|
||||
|
||||
r = new BN(r)
|
||||
s = new BN(s)
|
||||
|
||||
if (r.isZero() || r.gt(SECP256K1_N) || s.isZero() || s.gt(SECP256K1_N)) {
|
||||
return false
|
||||
}
|
||||
|
||||
if ((homestead === false) && (new BN(s).cmp(SECP256K1_N_DIV_2) === 1)) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a `Buffer` or `Array` to JSON
|
||||
* @param {Buffer|Array} ba
|
||||
* @return {Array|String|null}
|
||||
*/
|
||||
exports.baToJSON = function (ba) {
|
||||
if (Buffer.isBuffer(ba)) {
|
||||
return '0x' + ba.toString('hex')
|
||||
} else if (ba instanceof Array) {
|
||||
const array = []
|
||||
for (let i = 0; i < ba.length; i++) {
|
||||
array.push(exports.baToJSON(ba[i]))
|
||||
}
|
||||
return array
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines properties on a `Object`. It make the assumption that underlying data is binary.
|
||||
* @param {Object} self the `Object` to define properties on
|
||||
* @param {Array} fields an array fields to define. Fields can contain:
|
||||
* * `name` - the name of the properties
|
||||
* * `length` - the number of bytes the field can have
|
||||
* * `allowLess` - if the field can be less than the length
|
||||
* * `allowEmpty`
|
||||
* @param {*} data data to be validated against the definitions
|
||||
*/
|
||||
exports.defineProperties = function (self, fields, data) {
|
||||
self.raw = []
|
||||
self._fields = []
|
||||
|
||||
// attach the `toJSON`
|
||||
self.toJSON = function (label) {
|
||||
if (label) {
|
||||
const obj = {}
|
||||
self._fields.forEach((field) => {
|
||||
obj[field] = '0x' + self[field].toString('hex')
|
||||
})
|
||||
return obj
|
||||
}
|
||||
return exports.baToJSON(this.raw)
|
||||
}
|
||||
|
||||
self.serialize = function serialize () {
|
||||
return rlp.encode(self.raw)
|
||||
}
|
||||
|
||||
fields.forEach((field, i) => {
|
||||
self._fields.push(field.name)
|
||||
function getter () {
|
||||
return self.raw[i]
|
||||
}
|
||||
function setter (v) {
|
||||
v = exports.toBuffer(v)
|
||||
|
||||
if (v.toString('hex') === '00' && !field.allowZero) {
|
||||
v = Buffer.allocUnsafe(0)
|
||||
}
|
||||
|
||||
if (field.allowLess && field.length) {
|
||||
v = exports.stripZeros(v)
|
||||
assert(field.length >= v.length, 'The field ' + field.name + ' must not have more ' + field.length + ' bytes')
|
||||
} else if (!(field.allowZero && v.length === 0) && field.length) {
|
||||
assert(field.length === v.length, 'The field ' + field.name + ' must have byte length of ' + field.length)
|
||||
}
|
||||
|
||||
self.raw[i] = v
|
||||
}
|
||||
|
||||
Object.defineProperty(self, field.name, {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
get: getter,
|
||||
set: setter
|
||||
})
|
||||
|
||||
if (field.default) {
|
||||
self[field.name] = field.default
|
||||
}
|
||||
|
||||
// attach alias
|
||||
if (field.alias) {
|
||||
Object.defineProperty(self, field.alias, {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
set: setter,
|
||||
get: getter
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
// if the constuctor is passed data
|
||||
if (data) {
|
||||
if (typeof data === 'string') {
|
||||
data = Buffer.from(exports.stripHexPrefix(data), 'hex')
|
||||
}
|
||||
|
||||
if (Buffer.isBuffer(data)) {
|
||||
data = rlp.decode(data)
|
||||
}
|
||||
|
||||
if (Array.isArray(data)) {
|
||||
if (data.length > self._fields.length) {
|
||||
throw (new Error('wrong number of fields in data'))
|
||||
}
|
||||
|
||||
// make sure all the items are buffers
|
||||
data.forEach((d, i) => {
|
||||
self[self._fields[i]] = exports.toBuffer(d)
|
||||
})
|
||||
} else if (typeof data === 'object') {
|
||||
const keys = Object.keys(data)
|
||||
fields.forEach((field) => {
|
||||
if (keys.indexOf(field.name) !== -1) self[field.name] = data[field.name]
|
||||
if (keys.indexOf(field.alias) !== -1) self[field.alias] = data[field.alias]
|
||||
})
|
||||
} else {
|
||||
throw new Error('invalid data')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function calculateSigRecovery (v, chainId) {
|
||||
return chainId ? v - (2 * chainId + 35) : v - 27
|
||||
}
|
||||
|
||||
function isValidSigRecovery (recovery) {
|
||||
return recovery === 0 || recovery === 1
|
||||
}
|
||||
125
libs/ethereumjs-util/package.json
Normal file
125
libs/ethereumjs-util/package.json
Normal file
@@ -0,0 +1,125 @@
|
||||
{
|
||||
"name": "ethereumjs-util",
|
||||
"version": "6.0.0",
|
||||
"description": "a collection of utility functions for Ethereum",
|
||||
"main": "dist/index.js",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "browserify index.js -s ethUtil -o /tmp/ethereumjs-util.js",
|
||||
"coverage": "npm run build:dist && istanbul cover _mocha",
|
||||
"coveralls": "npm run coverage && coveralls <coverage/lcov.info",
|
||||
"lint": "standard",
|
||||
"prepublishOnly": "npm run test && npm run build:dist",
|
||||
"test": "npm run lint && npm run test:node && npm run test:browser",
|
||||
"test:browser": "npm run build:dist && karma start karma.conf.js",
|
||||
"test:node": "npm run build:dist && istanbul test mocha -- --reporter spec",
|
||||
"build:dist": "babel index.js --source-root ./ -d ./dist",
|
||||
"build:docs": "documentation build ./index.js --github --sort-order='alpha' -f md > ./docs/index.md"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ethereumjs/ethereumjs-util.git"
|
||||
},
|
||||
"keywords": [
|
||||
"ethereum",
|
||||
"utilties"
|
||||
],
|
||||
"author": "mjbecze <mjbecze@gmail.com>",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Tim Coulter",
|
||||
"email": "tim@timothyjcoulter.com",
|
||||
"url": "https://github.com/tcoulter",
|
||||
"contributions": 1,
|
||||
"additions": 2,
|
||||
"deletions": 2
|
||||
},
|
||||
{
|
||||
"name": "Nick Dodson",
|
||||
"url": "https://github.com/SilentCicero",
|
||||
"contributions": 2,
|
||||
"additions": 26,
|
||||
"deletions": 2
|
||||
},
|
||||
{
|
||||
"name": "Mr. Chico",
|
||||
"url": "https://github.com/MrChico",
|
||||
"contributions": 1,
|
||||
"additions": 11,
|
||||
"deletions": 1
|
||||
},
|
||||
{
|
||||
"name": "Dũng Trần",
|
||||
"email": "tad88.dev@gmail.com",
|
||||
"url": "https://github.com/tad88dev",
|
||||
"contributions": 2,
|
||||
"additions": 5,
|
||||
"deletions": 5
|
||||
},
|
||||
{
|
||||
"name": "Alex Beregszaszi",
|
||||
"email": "alex@rtfs.hu",
|
||||
"url": "https://github.com/axic",
|
||||
"contributions": 77,
|
||||
"additions": 1796,
|
||||
"deletions": 642
|
||||
},
|
||||
{
|
||||
"name": "Taylor Gerring",
|
||||
"url": "https://github.com/tgerring",
|
||||
"contributions": 1,
|
||||
"additions": 1,
|
||||
"deletions": 1
|
||||
},
|
||||
{
|
||||
"name": "Kirill Fomichev",
|
||||
"email": "fanatid@ya.ru",
|
||||
"url": "https://github.com/fanatid",
|
||||
"contributions": 8,
|
||||
"additions": 32,
|
||||
"deletions": 16
|
||||
},
|
||||
{
|
||||
"name": "kumavis",
|
||||
"email": "aaron@kumavis.me",
|
||||
"url": "https://github.com/kumavis",
|
||||
"contributions": 2,
|
||||
"additions": 2,
|
||||
"deletions": 2
|
||||
},
|
||||
{
|
||||
"name": "Alexander Sinyagin",
|
||||
"email": "sinyagin.alexander@gmail.com",
|
||||
"url": "https://github.com/asinyagin",
|
||||
"contributions": 1,
|
||||
"additions": 3,
|
||||
"deletions": 1
|
||||
}
|
||||
],
|
||||
"license": "MPL-2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ethereumjs/ethereumjs-util/issues"
|
||||
},
|
||||
"homepage": "https://github.com/ethereumjs/ethereumjs-util",
|
||||
"dependencies": {
|
||||
"bn.js": "^4.11.0",
|
||||
"create-hash": "^1.1.2",
|
||||
"ethjs-util": "^0.1.6",
|
||||
"keccak": "^1.0.2",
|
||||
"rlp": "^2.0.0",
|
||||
"safe-buffer": "^5.1.1",
|
||||
"secp256k1": "^3.0.1"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"standard": {
|
||||
"globals": [
|
||||
"describe",
|
||||
"it"
|
||||
],
|
||||
"ignore": [
|
||||
"dist/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
4
libs/ethereumjs-util/readme.md
Normal file
4
libs/ethereumjs-util/readme.md
Normal file
@@ -0,0 +1,4 @@
|
||||
Build (will create a bundle and copy it to /tmp/ethereumjs-util.js):
|
||||
|
||||
npm install
|
||||
npm run build
|
||||
15
libs/nanocurrency-web/nano-util.js
Executable file
15
libs/nanocurrency-web/nano-util.js
Executable file
@@ -0,0 +1,15 @@
|
||||
const NanoBase = require('nanocurrency-web');
|
||||
|
||||
window.nanoUtil = {
|
||||
getKeypair: function (index, seed) {
|
||||
const accounts = NanoBase.wallet.accounts(seed, index, index)
|
||||
return {privKey: accounts[0].privateKey, pubKey: accounts[0].publicKey, address: accounts[0].address};
|
||||
},
|
||||
dummyNetwork: {
|
||||
bip32: {public: 0, private: 0},
|
||||
messagePrefix: '',
|
||||
pubKeyHash: 0,
|
||||
scriptHash: 0,
|
||||
wif: 0,
|
||||
},
|
||||
}
|
||||
1614
libs/nanocurrency-web/package-lock.json
generated
Executable file
1614
libs/nanocurrency-web/package-lock.json
generated
Executable file
File diff suppressed because it is too large
Load Diff
14
libs/nanocurrency-web/package.json
Executable file
14
libs/nanocurrency-web/package.json
Executable file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "nano-util",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"build": "browserify nano-util.js > /tmp/nano-util.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"nanocurrency-web": "^1.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^16.2.3",
|
||||
"uglify-es": "^3.3.9"
|
||||
}
|
||||
}
|
||||
4
libs/nanocurrency-web/readme.md
Executable file
4
libs/nanocurrency-web/readme.md
Executable file
@@ -0,0 +1,4 @@
|
||||
Build (will create a bundle and copy it to /tmp/nano-util.js):
|
||||
|
||||
npm install
|
||||
npm run build
|
||||
1389
libs/stellar-util/package-lock.json
generated
Normal file
1389
libs/stellar-util/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
15
libs/stellar-util/package.json
Normal file
15
libs/stellar-util/package.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "stellar-util",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"build": "browserify stellar-util.js > /tmp/stellar-util.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"ed25519-hd-key": "^1.0.0",
|
||||
"stellar-base": "^0.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^16.2.3",
|
||||
"uglify-es": "^3.3.9"
|
||||
}
|
||||
}
|
||||
4
libs/stellar-util/readme.md
Normal file
4
libs/stellar-util/readme.md
Normal file
@@ -0,0 +1,4 @@
|
||||
Build (will create a bundle and copy it to /tmp/stellar-util.js):
|
||||
|
||||
npm install
|
||||
npm run build
|
||||
16
libs/stellar-util/stellar-util.js
Normal file
16
libs/stellar-util/stellar-util.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const StellarBase = require('stellar-base');
|
||||
const edHd = require('ed25519-hd-key');
|
||||
|
||||
window.stellarUtil = {
|
||||
getKeypair: function (path, seed) {
|
||||
const result = edHd.derivePath(path, seed);
|
||||
return StellarBase.Keypair.fromRawEd25519Seed(result.key);
|
||||
},
|
||||
dummyNetwork: {
|
||||
bip32: {public: 0, private: 0},
|
||||
messagePrefix: '',
|
||||
pubKeyHash: 0,
|
||||
scriptHash: 0,
|
||||
wif: 0,
|
||||
},
|
||||
}
|
||||
@@ -8,7 +8,8 @@ https://iancoleman.io/bip39/
|
||||
|
||||
## Standalone offline version
|
||||
|
||||
Download `bip39-standalone.html`
|
||||
Download `bip39-standalone.html` from
|
||||
[the releases](https://github.com/iancoleman/bip39/releases).
|
||||
|
||||
Open the file in a browser by double clicking it.
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ created with the following steps:
|
||||
1. include the changelog for this release as text for the release
|
||||
1. attach signature.txt.asc
|
||||
1. attach the bip39-standalone.html file
|
||||
1. Add a new post to twitter from @bip39tool with the version, link and hash
|
||||
1. Publish to any hosted locations (eg iancoleman.github.io/bip39)
|
||||
1. Download the file from the release and confirm it hashes to the expected value `sha256sum bip39-standalone.html`
|
||||
1. Download the signature from the release and verify it. `gpg --verify signature.txt.asc`
|
||||
1. Publish to any hosted locations (eg iancoleman.github.io/bip39)
|
||||
1. Add a new post to twitter from @bip39tool with the version, link and hash
|
||||
|
||||
@@ -106,3 +106,6 @@ body {
|
||||
.visual-privacy .private-data {
|
||||
display: none;
|
||||
}
|
||||
.text-weight-normal {
|
||||
font-weight: normal !important;
|
||||
}
|
||||
|
||||
985
src/css/bootstrap-3.3.7.css → src/css/bootstrap.css
vendored
985
src/css/bootstrap-3.3.7.css → src/css/bootstrap.css
vendored
File diff suppressed because it is too large
Load Diff
1
src/css/bootstrap.css.map
Normal file
1
src/css/bootstrap.css.map
Normal file
File diff suppressed because one or more lines are too long
306
src/index.html
306
src/index.html
@@ -3,7 +3,7 @@
|
||||
<head lang="en">
|
||||
<meta charset="utf-8" />
|
||||
<title>BIP39 - Mnemonic Code</title>
|
||||
<link rel="stylesheet" href="css/bootstrap-3.3.7.css">
|
||||
<link rel="stylesheet" href="css/bootstrap.css">
|
||||
<link rel="stylesheet" href="css/app.css">
|
||||
<meta content="Mnemonic code for generating deterministic keys" name="description"/>
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="container">
|
||||
|
||||
<h1 class="text-center">Mnemonic Code Converter</h1>
|
||||
<p class="version">v0.3.10</p>
|
||||
<p class="version">v0.5.4</p>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@@ -24,7 +24,7 @@
|
||||
<div class="form-group">
|
||||
<div class="col-sm-2"></div>
|
||||
<div class="col-sm-10">
|
||||
<p>You can enter an existing BIP39 mnemonic, or generate a new random one. Typing your own twelve words will probably not work how you expect, since the words require a particular structure (the last word is a checksum).</p>
|
||||
<p>You can enter an existing BIP39 mnemonic, or generate a new random one. Typing your own twelve words will probably not work how you expect, since the words require a particular structure (the last word contains a checksum).</p>
|
||||
<p>
|
||||
For more info see the
|
||||
<a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" target="_blank">BIP39 spec</a>.
|
||||
@@ -69,7 +69,7 @@
|
||||
<div class="form-group">
|
||||
<label for="entropy" class="col-sm-2 control-label">Entropy</label>
|
||||
<div class="col-sm-7">
|
||||
<textarea id="entropy" rows="2" class="entropy private-data form-control" placeholder="Accepts either binary, base 6, 6-sided dice, base 10, hexadecimal or cards"></textarea>
|
||||
<textarea id="entropy" rows="2" class="entropy private-data form-control" placeholder="Accepts either binary, base 6, 6-sided dice, base 10, hexadecimal or cards" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
|
||||
<div class="row filter-warning text-danger hidden">
|
||||
<p class="col-sm-12">
|
||||
<strong>
|
||||
@@ -86,7 +86,7 @@
|
||||
<div class="row">
|
||||
<label class="col-sm-3 control-label">Entropy Type</label>
|
||||
<div class="type col-sm-3 form-control-static"></div>
|
||||
<label class="col-sm-3 control-label">Bits Per Event</label>
|
||||
<label class="col-sm-3 control-label">Avg Bits Per Event</label>
|
||||
<div class="bits-per-event col-sm-3 form-control-static"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -119,16 +119,58 @@
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">PBKDF2 rounds</label>
|
||||
<div class="col-sm-9">
|
||||
<select class="pbkdf2-rounds form-control" style="width: 60%;float: left;">
|
||||
<option value="2048" selected>2048 <span>(compatibility)</span></option>
|
||||
<option value="4096">4096 <span>iterations</span></option>
|
||||
<option value="8192">8192 <span>iterations</span></option>
|
||||
<option value="16384">16384 <span>iterations</span></option>
|
||||
<option value="32768">32768 <span>iterations</span></option>
|
||||
<option value="custom">Custom <span>iterations</span></option>
|
||||
</select>
|
||||
<input type="number" class="form-control hidden" id="pbkdf2-custom-input" value="1" min="1" pattern="[0-9]" style="float: right;width: 40%;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<p>Valid entropy values include:</p>
|
||||
<ul>
|
||||
<li><strong>Binary</strong> [0-1]<br>101010011</li>
|
||||
<li><strong>Base 6</strong> [0-5]<br>123434014</li>
|
||||
<li><strong>Dice</strong> [1-6]<br>62535634</li>
|
||||
<li><strong>Base 10</strong> [0-9]<br>90834528</li>
|
||||
<li><strong>Hex</strong> [0-9A-F]<br>4187a8bfd9</li>
|
||||
<li><strong>Card</strong> [A2-9TJQK][CDHS]<br>ahqs9dtc</li>
|
||||
<li>
|
||||
<label>
|
||||
<input type="radio" name="entropy-type" value="binary">
|
||||
<strong>Binary</strong> [0-1]<br>101010011
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label>
|
||||
<input type="radio" name="entropy-type" value="base 6">
|
||||
<strong>Base 6</strong> [0-5]<br>123434014
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label>
|
||||
<input type="radio" name="entropy-type" value="dice">
|
||||
<strong>Dice</strong> [1-6]<br>62535634
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label>
|
||||
<input type="radio" name="entropy-type" value="base 10">
|
||||
<strong>Base 10</strong> [0-9]<br>90834528
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label>
|
||||
<input type="radio" name="entropy-type" value="hexadecimal" checked>
|
||||
<strong>Hex</strong> [0-9A-F]<br>4187a8bfd9
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label>
|
||||
<input type="radio" name="entropy-type" value="card">
|
||||
<strong>Card</strong> [A2-9TJQK][CDHS]<br>ahqs9dtc
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -151,6 +193,15 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-2"></div>
|
||||
<div class="col-sm-10 checkbox">
|
||||
<label>
|
||||
<input type="checkbox" class="autoCompute" checked>
|
||||
<span>Auto compute</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">Mnemonic Language</label>
|
||||
<div class="col-sm-10 languages">
|
||||
@@ -163,25 +214,53 @@
|
||||
<a href="#french" title="French">Français</a>
|
||||
<a href="#italian" title="Italian">Italiano</a>
|
||||
<a href="#korean" title="Korean">한국어</a>
|
||||
<a href="#czech" title="Czech">Čeština</a>
|
||||
<a href="#portuguese" title="Portuguese">Português</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group text-danger PBKDF2-infos-danger hidden">
|
||||
<label class="col-sm-2 control-label">Warning</label>
|
||||
<div class="col-sm-10 form-control-static">
|
||||
<span>You are using a custom number of PBKDF2 iterations. Your BIP39 seed may not show same addresses on a different software.</span>
|
||||
<a href="#PBKDF2-notes">Read more</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="phrase" class="col-sm-2 control-label">BIP39 Mnemonic</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea id="phrase" class="phrase private-data form-control" data-show-qr></textarea>
|
||||
<textarea id="phrase" class="phrase private-data form-control" data-show-qr autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="splitMnemonic hidden">
|
||||
<label for="phrase" class="col-sm-2 control-label">BIP39 Split Mnemonic</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea id="phraseSplit" class="phraseSplit private-data form-control" title="Only 2 of 3 cards needed to recover." rows="3"></textarea>
|
||||
<p class="help-block">
|
||||
<span id="phraseSplitWarn" class="phraseSplitWarn"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<label class="control-label text-weight-normal">
|
||||
<input type="checkbox" class="showSplitMnemonic">
|
||||
Show split mnemonic cards
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="passphrase" class="col-sm-2 control-label">BIP39 Passphrase (optional)</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea id="passphrase" class="passphrase private-data form-control"></textarea>
|
||||
<textarea id="passphrase" class="passphrase private-data form-control" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="seed" class="col-sm-2 control-label">BIP39 Seed</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea id="seed" class="seed private-data form-control" readonly="readonly" data-show-qr></textarea>
|
||||
<textarea id="seed" class="seed private-data form-control" data-show-qr autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -195,9 +274,116 @@
|
||||
<div class="form-group">
|
||||
<label for="root-key" class="col-sm-2 control-label">BIP32 Root Key</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea id="root-key" class="root-key private-data form-control" data-show-qr></textarea>
|
||||
<textarea id="root-key" class="root-key private-data form-control" data-show-qr autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-2"></div>
|
||||
<div class="col-sm-10">
|
||||
<label class="control-label text-weight-normal">
|
||||
<input type="checkbox" class="showBip85" />
|
||||
Show BIP85
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group bip85 hidden">
|
||||
<div class="form-group text-danger">
|
||||
<label class="col-sm-2 control-label">Warning</label>
|
||||
<div class="col-sm-10 form-control-static">
|
||||
This is an advanced feature and should only be used if you understand what it does.
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2"></label>
|
||||
<div class="col-sm-10">
|
||||
<p>
|
||||
The value of the "BIP85 Child Key" field shown below is not used
|
||||
elsewhere on this page. It can be used as a new key.
|
||||
</p>
|
||||
<p>
|
||||
In case of the BIP39 application, you can paste it into the "BIP39 Mnemonic"
|
||||
field to use it as a new mnemonic.
|
||||
</p>
|
||||
<p>
|
||||
Please read the
|
||||
<a href="https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki" target="_blank">
|
||||
BIP85 spec
|
||||
</a>
|
||||
for more information.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<label for="bip85-application" class="col-sm-2 control-label">BIP85 Application</label>
|
||||
<div class="col-sm-10">
|
||||
<select id="bip85-application" class="form-control">
|
||||
<option value="bip39" selected>BIP39</option>
|
||||
<option value="wif">WIF</option>
|
||||
<option value="xprv">Xprv</option>
|
||||
<option value="hex">Hex</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group bip85 bip85-mnemonic-language-input hidden">
|
||||
<label for="bip85-mnemonic-language" class="col-sm-2 control-label">BIP85 Mnemonic Language</label>
|
||||
<div class="col-sm-10 languages">
|
||||
<select id="bip85-mnemonic-language" class="strength form-control">
|
||||
<option value="0" selected>English</option>
|
||||
<!--<option value="1">日本語</option>
|
||||
<option value="2">한국어</option>
|
||||
<option value="3">Español</option>
|
||||
<option value="4">中文(简体)</option>
|
||||
<option value="5">中文(繁體)</option>
|
||||
<option value="6">Français</option>
|
||||
<option value="7">Italiano</option>
|
||||
<option value="8">Čeština</option>
|
||||
<option value="9">Português</option>-->
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group bip85 bip85-mnemonic-length-input hidden">
|
||||
<label for="bip85-mnemonic-length" class="col-sm-2 control-label">BIP85 Mnemonic Length</label>
|
||||
<div class="col-sm-10">
|
||||
<select id="bip85-mnemonic-length" class="strength form-control">
|
||||
<option value="12" selected>12</option>
|
||||
<option value="18">18</option>
|
||||
<option value="24">24</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group bip85 hidden">
|
||||
<span class="bip85-bytes-input">
|
||||
<label for="bip85-bytes" class="col-sm-2 control-label">BIP85 Bytes</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="bip85-bytes" type="text" class="change form-control" value="64" />
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="form-group bip85 bip85-index-input hidden">
|
||||
<label for="bip85-index" class="col-sm-2 control-label">BIP85 Index</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="bip85-index" type="text" class="change form-control" value="0" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group bip85 hidden">
|
||||
<label for="phrase" class="col-sm-2 control-label">BIP85 Child Key</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea
|
||||
id="bip85Field"
|
||||
data-show-qr
|
||||
class="bip85Field private-data form-control"
|
||||
title="BIP85 Child Key"
|
||||
rows="3"
|
||||
></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group litecoin-ltub-container hidden">
|
||||
<label for="litecoin-use-ltub" class="col-sm-2 control-label">Prefixes</label>
|
||||
<div class="col-sm-10 checkbox">
|
||||
@@ -273,7 +459,7 @@
|
||||
<a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" target="_blank">External / Internal</a>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="change-bip44" type="text" class="change form-control" value="0">
|
||||
<input id="change-bip44" type="text" class="change form-control" value="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -288,7 +474,7 @@
|
||||
<span>Account Extended Private Key</span>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea id="account-xprv-bip44" type="text" class="account-xprv private-data form-control" readonly data-show-qr></textarea>
|
||||
<textarea id="account-xprv-bip44" type="text" class="account-xprv private-data form-control" readonly data-show-qr autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -296,7 +482,7 @@
|
||||
<span>Account Extended Public Key</span>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea id="account-xpub-bip44" type="text" class="account-xpub form-control" readonly data-show-qr></textarea>
|
||||
<textarea id="account-xpub-bip44" type="text" class="account-xpub form-control" readonly data-show-qr autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -339,13 +525,6 @@
|
||||
<input id="bip32-path" type="text" class="path form-control" value="m/0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-2"></div>
|
||||
<label class="col-sm-10">
|
||||
<input class="hardened-addresses" type="checkbox">
|
||||
<span>Use hardened addresses</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="core-path" class="col-sm-2 control-label">Bitcoin Core</label>
|
||||
<div class="col-sm-10">
|
||||
@@ -363,6 +542,7 @@
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control no-border">
|
||||
<span>Use path <code>m/0'/0</code>.</span>
|
||||
<span>For change addresses use path <code>m/0'/1</code>.</span>
|
||||
</p>
|
||||
<p class="form-control no-border">
|
||||
<span>For more info see</span>
|
||||
@@ -448,7 +628,7 @@
|
||||
<span>Account Extended Private Key</span>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea id="account-xprv-bip49" type="text" class="account-xprv private-data form-control" readonly data-show-qr></textarea>
|
||||
<textarea id="account-xprv-bip49" type="text" class="account-xprv private-data form-control" readonly data-show-qr autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -456,7 +636,7 @@
|
||||
<span>Account Extended Public Key</span>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea id="account-xpub-bip49" type="text" class="account-xpub form-control" readonly data-show-qr></textarea>
|
||||
<textarea id="account-xpub-bip49" type="text" class="account-xpub form-control" readonly data-show-qr autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -506,6 +686,8 @@
|
||||
<select class="form-control bip141-semantics">
|
||||
<option value="p2wpkh">P2WPKH</option>
|
||||
<option value="p2wpkh-p2sh" selected>P2WPKH nested in P2SH</option>
|
||||
<option value="p2wsh">P2WSH (1-of-1 multisig)</option>
|
||||
<option value="p2wsh-p2sh">P2WSH nested in P2SH (1-of-1 multisig)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -575,7 +757,7 @@
|
||||
<span>Account Extended Private Key</span>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea id="account-xprv-bip84" type="text" class="account-xprv private-data form-control" readonly data-show-qr></textarea>
|
||||
<textarea id="account-xprv-bip84" type="text" class="account-xprv private-data form-control" readonly data-show-qr autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -583,7 +765,7 @@
|
||||
<span>Account Extended Public Key</span>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea id="account-xpub-bip84" type="text" class="account-xpub form-control" readonly data-show-qr></textarea>
|
||||
<textarea id="account-xpub-bip84" type="text" class="account-xpub form-control" readonly data-show-qr autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -607,13 +789,13 @@
|
||||
<div class="form-group">
|
||||
<label for="extended-priv-key" class="col-sm-2 control-label">BIP32 Extended Private Key</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea id="extended-priv-key" class="extended-priv-key private-data form-control" readonly="readonly" data-show-qr></textarea>
|
||||
<textarea id="extended-priv-key" class="extended-priv-key private-data form-control" readonly="readonly" data-show-qr autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="extended-pub-key" class="col-sm-2 control-label">BIP32 Extended Public Key</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea id="extended-pub-key" class="extended-pub-key form-control" readonly="readonly" data-show-qr></textarea>
|
||||
<textarea id="extended-pub-key" class="extended-pub-key form-control" readonly="readonly" data-show-qr autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -653,10 +835,18 @@
|
||||
<input type="checkbox" class="use-bip38">
|
||||
<span>Encrypt private keys using BIP38 and this password:</span>
|
||||
</label>
|
||||
<input class="bip38-password private-data">
|
||||
<input class="bip38-password private-data" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
|
||||
<span>Enabling BIP38 means each key will take several minutes to generate.</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input class="hardened-addresses" type="checkbox">
|
||||
<span>Use hardened addresses</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="addresses-type nav nav-tabs" role="tablist">
|
||||
<li id="table-tab" class="active">
|
||||
<a href="#table" role="tab" data-toggle="tab">Table</a>
|
||||
@@ -707,7 +897,7 @@
|
||||
</div>
|
||||
<div id="csv" class="tab-pane">
|
||||
<div class="col-md-12">
|
||||
<textarea class="csv form-control" rows="25" readonly></textarea>
|
||||
<textarea class="csv form-control" rows="25" readonly autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -748,6 +938,11 @@
|
||||
Read more at the
|
||||
<a href="https://github.com/bitcoin/bips/blob/master/bip-0049.mediawiki" target="_blank">official BIP49 spec</a>
|
||||
</p>
|
||||
<h3>BIP85 <span class="small">Deterministic Entropy From BIP32 Keychains</span></h3>
|
||||
<p>
|
||||
Read more at the
|
||||
<a href="https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki" target="_blank">official BIP85 spec</a>
|
||||
</p>
|
||||
<h3 id="entropy-notes">Entropy</h3>
|
||||
<p>
|
||||
<span>Entropy values should not include the BIP39 checksum. This is automatically added by the tool.</span>
|
||||
@@ -784,6 +979,25 @@
|
||||
<p>
|
||||
<a href="https://bitcointalk.org/index.php?topic=311000.msg3345309#msg3345309" target="_blank">You are not a good source of entropy.</a>
|
||||
</p>
|
||||
<p>
|
||||
<span>Card entropy has been implemented assuming cards are replaced, not drawn one after another.</span>
|
||||
<span>A full deck with replacement generates 232 bits of entropy (21 words). A full deck without replacement generates 225 bits of entropy (21 words).</span>
|
||||
<span>Card entropy changed significantly from v0.4.3 to v0.5.0. The old version can be accessed at
|
||||
<a href="https://github.com/iancoleman/bip39/releases/tag/0.4.3">
|
||||
https://github.com/iancoleman/bip39/releases/tag/0.4.3
|
||||
</a>
|
||||
or
|
||||
<a href="https://web.archive.org/web/20201018232020/https://iancoleman.io/bip39/">
|
||||
https://web.archive.org/web/20201018232020/https://iancoleman.io/bip39/
|
||||
</a>
|
||||
</span>
|
||||
</p>
|
||||
<h3 id="PBKDF2-notes">PBKDF2</h3>
|
||||
<p><a href="https://learnmeabitcoin.com/technical/mnemonic#pbkdf2---password-based-key-derivation-function-2 " target="_blank">What is PBKDF2 (Password Based Key Derivation Function 2) ?</a></p>
|
||||
<p><span>Please refer to this <a href="https://en.wikipedia.org/wiki/PBKDF2" target="_blank">wikipedia article</a> for more detail.
|
||||
<span>Mail about PBKDF2 security <a href="https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2016-July/012902.html" target="_blank">here</a>.</p>
|
||||
<p>Wallet software that implement BIP39 only use 2048 iterations as a norm. Increasing this parameter will increase security against brute force attack, but you will need to store this new parameter. However, as long as you back up your BIP39 seed there will not be risk to lost your fund. To access them with custom PBKDF2 iterations, use this file (or <a href="https://stuff.birkenstab.de/pbkdf2/" target="_blank">other</a>) to compute your targeted BIP39 seed.</p>
|
||||
<p>Using less than 2048 PBKDF2 iterations is insecure without strong optional BIP39 Passphrase.</p>
|
||||
<h3>License</h3>
|
||||
<p>
|
||||
<span>Please refer to <a href="https://github.com/iancoleman/bip39/blob/master/LICENSE" target="_blank">the software license</a> for more detail.
|
||||
@@ -827,9 +1041,9 @@
|
||||
on any offline computer.
|
||||
</p>
|
||||
<p>
|
||||
<span>Alternatively, download the file from the repository</span>
|
||||
<span>Alternatively, download the file from the latest GitHub release</span>
|
||||
-
|
||||
<a href="https://github.com/iancoleman/bip39">https://github.com/iancoleman/bip39</a>
|
||||
<a href="https://github.com/iancoleman/bip39/releases/latest/">https://github.com/iancoleman/bip39/releases/latest/</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
@@ -913,20 +1127,18 @@
|
||||
<td class="privkey private-data"><span data-show-qr></span></td>
|
||||
</tr>
|
||||
</script>
|
||||
<script src="js/polyfill.es6.js"></script>
|
||||
<script src="js/basex.js"></script>
|
||||
<script src="js/unorm.js"></script>
|
||||
<script src="js/jquery-3.2.1.js"></script>
|
||||
<script src="js/bootstrap-3.3.7.js"></script>
|
||||
<script src="js/levenshtein.js"></script>
|
||||
<script src="js/kjua-0.1.1.min.js"></script>
|
||||
<script src="js/bitcoinjs-3.3.2.js"></script>
|
||||
<script src="js/bootstrap.js"></script>
|
||||
<script src="js/bip39-libs.js"></script>
|
||||
<script src="js/bitcoinjs-extensions.js"></script>
|
||||
<script src="js/bitcoinjs-bip38-2.0.2.js"></script>
|
||||
<script src="js/segwit-parameters.js"></script>
|
||||
<script src="js/ethereumjs-util.js"></script>
|
||||
<script src="js/ripple-util.js"></script>
|
||||
<script src="js/bchaddrjs-0.2.1.js"></script>
|
||||
<script src="js/jingtum-util.js"></script>
|
||||
<script src="js/casinocoin-util.js"></script>
|
||||
<script src="js/cosmos-util.js"></script>
|
||||
<script src="js/eos-util.js"></script>
|
||||
<script src="js/fio-util.js"></script>
|
||||
<script src="js/xwc-util.js"></script>
|
||||
<script src="js/sjcl-bip39.js"></script>
|
||||
<script src="js/wordlist_english.js"></script>
|
||||
<script src="js/wordlist_japanese.js"></script>
|
||||
@@ -936,9 +1148,9 @@
|
||||
<script src="js/wordlist_french.js"></script>
|
||||
<script src="js/wordlist_italian.js"></script>
|
||||
<script src="js/wordlist_korean.js"></script>
|
||||
<script src="js/wordlist_czech.js"></script>
|
||||
<script src="js/wordlist_portuguese.js"></script>
|
||||
<script src="js/jsbip39.js"></script>
|
||||
<script src="js/biginteger.js"></script>
|
||||
<script src="js/zxcvbn.js"></script>
|
||||
<script src="js/entropy.js"></script>
|
||||
<script src="js/index.js"></script>
|
||||
</body>
|
||||
|
||||
2010
src/js/basex.js
2010
src/js/basex.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1620
src/js/biginteger.js
1620
src/js/biginteger.js
File diff suppressed because it is too large
Load Diff
1
src/js/bip39-libs.js
Executable file
1
src/js/bip39-libs.js
Executable file
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
397
src/js/bootstrap-3.3.7.js → src/js/bootstrap.js
vendored
397
src/js/bootstrap-3.3.7.js → src/js/bootstrap.js
vendored
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* Bootstrap v3.3.7 (http://getbootstrap.com)
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Bootstrap v3.4.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under the MIT license
|
||||
*/
|
||||
|
||||
@@ -17,10 +17,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: transition.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#transitions
|
||||
* Bootstrap: transition.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#transitions
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -28,7 +28,7 @@ if (typeof jQuery === 'undefined') {
|
||||
+function ($) {
|
||||
'use strict';
|
||||
|
||||
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
|
||||
// CSS TRANSITION SUPPORT (Shoutout: https://modernizr.com/)
|
||||
// ============================================================
|
||||
|
||||
function transitionEnd() {
|
||||
@@ -50,7 +50,7 @@ if (typeof jQuery === 'undefined') {
|
||||
return false // explicit for ie8 ( ._.)
|
||||
}
|
||||
|
||||
// http://blog.alexmaccaw.com/css-transitions
|
||||
// https://blog.alexmaccaw.com/css-transitions
|
||||
$.fn.emulateTransitionEnd = function (duration) {
|
||||
var called = false
|
||||
var $el = this
|
||||
@@ -77,10 +77,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: alert.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#alerts
|
||||
* Bootstrap: alert.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#alerts
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -96,7 +96,7 @@ if (typeof jQuery === 'undefined') {
|
||||
$(el).on('click', dismiss, this.close)
|
||||
}
|
||||
|
||||
Alert.VERSION = '3.3.7'
|
||||
Alert.VERSION = '3.4.1'
|
||||
|
||||
Alert.TRANSITION_DURATION = 150
|
||||
|
||||
@@ -109,7 +109,8 @@ if (typeof jQuery === 'undefined') {
|
||||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
||||
}
|
||||
|
||||
var $parent = $(selector === '#' ? [] : selector)
|
||||
selector = selector === '#' ? [] : selector
|
||||
var $parent = $(document).find(selector)
|
||||
|
||||
if (e) e.preventDefault()
|
||||
|
||||
@@ -172,10 +173,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: button.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#buttons
|
||||
* Bootstrap: button.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#buttons
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -192,7 +193,7 @@ if (typeof jQuery === 'undefined') {
|
||||
this.isLoading = false
|
||||
}
|
||||
|
||||
Button.VERSION = '3.3.7'
|
||||
Button.VERSION = '3.4.1'
|
||||
|
||||
Button.DEFAULTS = {
|
||||
loadingText: 'loading...'
|
||||
@@ -298,10 +299,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: carousel.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#carousel
|
||||
* Bootstrap: carousel.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#carousel
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -329,7 +330,7 @@ if (typeof jQuery === 'undefined') {
|
||||
.on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
|
||||
}
|
||||
|
||||
Carousel.VERSION = '3.3.7'
|
||||
Carousel.VERSION = '3.4.1'
|
||||
|
||||
Carousel.TRANSITION_DURATION = 600
|
||||
|
||||
@@ -443,7 +444,9 @@ if (typeof jQuery === 'undefined') {
|
||||
var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
|
||||
if ($.support.transition && this.$element.hasClass('slide')) {
|
||||
$next.addClass(type)
|
||||
$next[0].offsetWidth // force reflow
|
||||
if (typeof $next === 'object' && $next.length) {
|
||||
$next[0].offsetWidth // force reflow
|
||||
}
|
||||
$active.addClass(direction)
|
||||
$next.addClass(direction)
|
||||
$active
|
||||
@@ -505,10 +508,17 @@ if (typeof jQuery === 'undefined') {
|
||||
// =================
|
||||
|
||||
var clickHandler = function (e) {
|
||||
var href
|
||||
var $this = $(this)
|
||||
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
|
||||
var href = $this.attr('href')
|
||||
if (href) {
|
||||
href = href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
|
||||
}
|
||||
|
||||
var target = $this.attr('data-target') || href
|
||||
var $target = $(document).find(target)
|
||||
|
||||
if (!$target.hasClass('carousel')) return
|
||||
|
||||
var options = $.extend({}, $target.data(), $this.data())
|
||||
var slideIndex = $this.attr('data-slide-to')
|
||||
if (slideIndex) options.interval = false
|
||||
@@ -536,10 +546,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: collapse.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#collapse
|
||||
* Bootstrap: collapse.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#collapse
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -567,7 +577,7 @@ if (typeof jQuery === 'undefined') {
|
||||
if (this.options.toggle) this.toggle()
|
||||
}
|
||||
|
||||
Collapse.VERSION = '3.3.7'
|
||||
Collapse.VERSION = '3.4.1'
|
||||
|
||||
Collapse.TRANSITION_DURATION = 350
|
||||
|
||||
@@ -674,7 +684,7 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
|
||||
Collapse.prototype.getParent = function () {
|
||||
return $(this.options.parent)
|
||||
return $(document).find(this.options.parent)
|
||||
.find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
|
||||
.each($.proxy(function (i, element) {
|
||||
var $element = $(element)
|
||||
@@ -697,7 +707,7 @@ if (typeof jQuery === 'undefined') {
|
||||
var target = $trigger.attr('data-target')
|
||||
|| (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
|
||||
|
||||
return $(target)
|
||||
return $(document).find(target)
|
||||
}
|
||||
|
||||
|
||||
@@ -749,10 +759,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: dropdown.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#dropdowns
|
||||
* Bootstrap: dropdown.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#dropdowns
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -769,7 +779,7 @@ if (typeof jQuery === 'undefined') {
|
||||
$(element).on('click.bs.dropdown', this.toggle)
|
||||
}
|
||||
|
||||
Dropdown.VERSION = '3.3.7'
|
||||
Dropdown.VERSION = '3.4.1'
|
||||
|
||||
function getParent($this) {
|
||||
var selector = $this.attr('data-target')
|
||||
@@ -779,7 +789,7 @@ if (typeof jQuery === 'undefined') {
|
||||
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
||||
}
|
||||
|
||||
var $parent = selector && $(selector)
|
||||
var $parent = selector !== '#' ? $(document).find(selector) : null
|
||||
|
||||
return $parent && $parent.length ? $parent : $this.parent()
|
||||
}
|
||||
@@ -915,10 +925,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: modal.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#modals
|
||||
* Bootstrap: modal.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#modals
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -930,15 +940,16 @@ if (typeof jQuery === 'undefined') {
|
||||
// ======================
|
||||
|
||||
var Modal = function (element, options) {
|
||||
this.options = options
|
||||
this.$body = $(document.body)
|
||||
this.$element = $(element)
|
||||
this.$dialog = this.$element.find('.modal-dialog')
|
||||
this.$backdrop = null
|
||||
this.isShown = null
|
||||
this.originalBodyPad = null
|
||||
this.scrollbarWidth = 0
|
||||
this.options = options
|
||||
this.$body = $(document.body)
|
||||
this.$element = $(element)
|
||||
this.$dialog = this.$element.find('.modal-dialog')
|
||||
this.$backdrop = null
|
||||
this.isShown = null
|
||||
this.originalBodyPad = null
|
||||
this.scrollbarWidth = 0
|
||||
this.ignoreBackdropClick = false
|
||||
this.fixedContent = '.navbar-fixed-top, .navbar-fixed-bottom'
|
||||
|
||||
if (this.options.remote) {
|
||||
this.$element
|
||||
@@ -949,7 +960,7 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
}
|
||||
|
||||
Modal.VERSION = '3.3.7'
|
||||
Modal.VERSION = '3.4.1'
|
||||
|
||||
Modal.TRANSITION_DURATION = 300
|
||||
Modal.BACKDROP_TRANSITION_DURATION = 150
|
||||
@@ -966,7 +977,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
Modal.prototype.show = function (_relatedTarget) {
|
||||
var that = this
|
||||
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
|
||||
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
@@ -1057,8 +1068,8 @@ if (typeof jQuery === 'undefined') {
|
||||
.off('focusin.bs.modal') // guard against infinite focus loop
|
||||
.on('focusin.bs.modal', $.proxy(function (e) {
|
||||
if (document !== e.target &&
|
||||
this.$element[0] !== e.target &&
|
||||
!this.$element.has(e.target).length) {
|
||||
this.$element[0] !== e.target &&
|
||||
!this.$element.has(e.target).length) {
|
||||
this.$element.trigger('focus')
|
||||
}
|
||||
}, this))
|
||||
@@ -1160,7 +1171,7 @@ if (typeof jQuery === 'undefined') {
|
||||
var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
|
||||
|
||||
this.$element.css({
|
||||
paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
|
||||
paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
|
||||
paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
|
||||
})
|
||||
}
|
||||
@@ -1185,11 +1196,26 @@ if (typeof jQuery === 'undefined') {
|
||||
Modal.prototype.setScrollbar = function () {
|
||||
var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
|
||||
this.originalBodyPad = document.body.style.paddingRight || ''
|
||||
if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
|
||||
var scrollbarWidth = this.scrollbarWidth
|
||||
if (this.bodyIsOverflowing) {
|
||||
this.$body.css('padding-right', bodyPad + scrollbarWidth)
|
||||
$(this.fixedContent).each(function (index, element) {
|
||||
var actualPadding = element.style.paddingRight
|
||||
var calculatedPadding = $(element).css('padding-right')
|
||||
$(element)
|
||||
.data('padding-right', actualPadding)
|
||||
.css('padding-right', parseFloat(calculatedPadding) + scrollbarWidth + 'px')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Modal.prototype.resetScrollbar = function () {
|
||||
this.$body.css('padding-right', this.originalBodyPad)
|
||||
$(this.fixedContent).each(function (index, element) {
|
||||
var padding = $(element).data('padding-right')
|
||||
$(element).removeData('padding-right')
|
||||
element.style.paddingRight = padding ? padding : ''
|
||||
})
|
||||
}
|
||||
|
||||
Modal.prototype.measureScrollbar = function () { // thx walsh
|
||||
@@ -1207,8 +1233,8 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
function Plugin(option, _relatedTarget) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.modal')
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.modal')
|
||||
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||
|
||||
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
|
||||
@@ -1219,7 +1245,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
var old = $.fn.modal
|
||||
|
||||
$.fn.modal = Plugin
|
||||
$.fn.modal = Plugin
|
||||
$.fn.modal.Constructor = Modal
|
||||
|
||||
|
||||
@@ -1236,10 +1262,13 @@ if (typeof jQuery === 'undefined') {
|
||||
// ==============
|
||||
|
||||
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
|
||||
var $this = $(this)
|
||||
var href = $this.attr('href')
|
||||
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
|
||||
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
||||
var $this = $(this)
|
||||
var href = $this.attr('href')
|
||||
var target = $this.attr('data-target') ||
|
||||
(href && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
|
||||
|
||||
var $target = $(document).find(target)
|
||||
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
||||
|
||||
if ($this.is('a')) e.preventDefault()
|
||||
|
||||
@@ -1255,18 +1284,148 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: tooltip.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#tooltip
|
||||
* Bootstrap: tooltip.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#tooltip
|
||||
* Inspired by the original jQuery.tipsy by Jason Frame
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) {
|
||||
'use strict';
|
||||
|
||||
var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']
|
||||
|
||||
var uriAttrs = [
|
||||
'background',
|
||||
'cite',
|
||||
'href',
|
||||
'itemtype',
|
||||
'longdesc',
|
||||
'poster',
|
||||
'src',
|
||||
'xlink:href'
|
||||
]
|
||||
|
||||
var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i
|
||||
|
||||
var DefaultWhitelist = {
|
||||
// Global attributes allowed on any supplied element below.
|
||||
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
|
||||
a: ['target', 'href', 'title', 'rel'],
|
||||
area: [],
|
||||
b: [],
|
||||
br: [],
|
||||
col: [],
|
||||
code: [],
|
||||
div: [],
|
||||
em: [],
|
||||
hr: [],
|
||||
h1: [],
|
||||
h2: [],
|
||||
h3: [],
|
||||
h4: [],
|
||||
h5: [],
|
||||
h6: [],
|
||||
i: [],
|
||||
img: ['src', 'alt', 'title', 'width', 'height'],
|
||||
li: [],
|
||||
ol: [],
|
||||
p: [],
|
||||
pre: [],
|
||||
s: [],
|
||||
small: [],
|
||||
span: [],
|
||||
sub: [],
|
||||
sup: [],
|
||||
strong: [],
|
||||
u: [],
|
||||
ul: []
|
||||
}
|
||||
|
||||
/**
|
||||
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
||||
*
|
||||
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
||||
*/
|
||||
var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi
|
||||
|
||||
/**
|
||||
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
||||
*
|
||||
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
||||
*/
|
||||
var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i
|
||||
|
||||
function allowedAttribute(attr, allowedAttributeList) {
|
||||
var attrName = attr.nodeName.toLowerCase()
|
||||
|
||||
if ($.inArray(attrName, allowedAttributeList) !== -1) {
|
||||
if ($.inArray(attrName, uriAttrs) !== -1) {
|
||||
return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN))
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var regExp = $(allowedAttributeList).filter(function (index, value) {
|
||||
return value instanceof RegExp
|
||||
})
|
||||
|
||||
// Check if a regular expression validates the attribute.
|
||||
for (var i = 0, l = regExp.length; i < l; i++) {
|
||||
if (attrName.match(regExp[i])) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
|
||||
if (unsafeHtml.length === 0) {
|
||||
return unsafeHtml
|
||||
}
|
||||
|
||||
if (sanitizeFn && typeof sanitizeFn === 'function') {
|
||||
return sanitizeFn(unsafeHtml)
|
||||
}
|
||||
|
||||
// IE 8 and below don't support createHTMLDocument
|
||||
if (!document.implementation || !document.implementation.createHTMLDocument) {
|
||||
return unsafeHtml
|
||||
}
|
||||
|
||||
var createdDocument = document.implementation.createHTMLDocument('sanitization')
|
||||
createdDocument.body.innerHTML = unsafeHtml
|
||||
|
||||
var whitelistKeys = $.map(whiteList, function (el, i) { return i })
|
||||
var elements = $(createdDocument.body).find('*')
|
||||
|
||||
for (var i = 0, len = elements.length; i < len; i++) {
|
||||
var el = elements[i]
|
||||
var elName = el.nodeName.toLowerCase()
|
||||
|
||||
if ($.inArray(elName, whitelistKeys) === -1) {
|
||||
el.parentNode.removeChild(el)
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
var attributeList = $.map(el.attributes, function (el) { return el })
|
||||
var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || [])
|
||||
|
||||
for (var j = 0, len2 = attributeList.length; j < len2; j++) {
|
||||
if (!allowedAttribute(attributeList[j], whitelistedAttributes)) {
|
||||
el.removeAttribute(attributeList[j].nodeName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return createdDocument.body.innerHTML
|
||||
}
|
||||
|
||||
// TOOLTIP PUBLIC CLASS DEFINITION
|
||||
// ===============================
|
||||
|
||||
@@ -1282,7 +1441,7 @@ if (typeof jQuery === 'undefined') {
|
||||
this.init('tooltip', element, options)
|
||||
}
|
||||
|
||||
Tooltip.VERSION = '3.3.7'
|
||||
Tooltip.VERSION = '3.4.1'
|
||||
|
||||
Tooltip.TRANSITION_DURATION = 150
|
||||
|
||||
@@ -1299,7 +1458,10 @@ if (typeof jQuery === 'undefined') {
|
||||
viewport: {
|
||||
selector: 'body',
|
||||
padding: 0
|
||||
}
|
||||
},
|
||||
sanitize : true,
|
||||
sanitizeFn : null,
|
||||
whiteList : DefaultWhitelist
|
||||
}
|
||||
|
||||
Tooltip.prototype.init = function (type, element, options) {
|
||||
@@ -1307,7 +1469,7 @@ if (typeof jQuery === 'undefined') {
|
||||
this.type = type
|
||||
this.$element = $(element)
|
||||
this.options = this.getOptions(options)
|
||||
this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
|
||||
this.$viewport = this.options.viewport && $(document).find($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
|
||||
this.inState = { click: false, hover: false, focus: false }
|
||||
|
||||
if (this.$element[0] instanceof document.constructor && !this.options.selector) {
|
||||
@@ -1340,7 +1502,15 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
|
||||
Tooltip.prototype.getOptions = function (options) {
|
||||
options = $.extend({}, this.getDefaults(), this.$element.data(), options)
|
||||
var dataAttributes = this.$element.data()
|
||||
|
||||
for (var dataAttr in dataAttributes) {
|
||||
if (dataAttributes.hasOwnProperty(dataAttr) && $.inArray(dataAttr, DISALLOWED_ATTRIBUTES) !== -1) {
|
||||
delete dataAttributes[dataAttr]
|
||||
}
|
||||
}
|
||||
|
||||
options = $.extend({}, this.getDefaults(), dataAttributes, options)
|
||||
|
||||
if (options.delay && typeof options.delay == 'number') {
|
||||
options.delay = {
|
||||
@@ -1349,6 +1519,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
}
|
||||
|
||||
if (options.sanitize) {
|
||||
options.template = sanitizeHtml(options.template, options.whiteList, options.sanitizeFn)
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
@@ -1460,7 +1634,7 @@ if (typeof jQuery === 'undefined') {
|
||||
.addClass(placement)
|
||||
.data('bs.' + this.type, this)
|
||||
|
||||
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
||||
this.options.container ? $tip.appendTo($(document).find(this.options.container)) : $tip.insertAfter(this.$element)
|
||||
this.$element.trigger('inserted.bs.' + this.type)
|
||||
|
||||
var pos = this.getPosition()
|
||||
@@ -1562,7 +1736,16 @@ if (typeof jQuery === 'undefined') {
|
||||
var $tip = this.tip()
|
||||
var title = this.getTitle()
|
||||
|
||||
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
|
||||
if (this.options.html) {
|
||||
if (this.options.sanitize) {
|
||||
title = sanitizeHtml(title, this.options.whiteList, this.options.sanitizeFn)
|
||||
}
|
||||
|
||||
$tip.find('.tooltip-inner').html(title)
|
||||
} else {
|
||||
$tip.find('.tooltip-inner').text(title)
|
||||
}
|
||||
|
||||
$tip.removeClass('fade in top bottom left right')
|
||||
}
|
||||
|
||||
@@ -1743,6 +1926,9 @@ if (typeof jQuery === 'undefined') {
|
||||
})
|
||||
}
|
||||
|
||||
Tooltip.prototype.sanitizeHtml = function (unsafeHtml) {
|
||||
return sanitizeHtml(unsafeHtml, this.options.whiteList, this.options.sanitizeFn)
|
||||
}
|
||||
|
||||
// TOOLTIP PLUGIN DEFINITION
|
||||
// =========================
|
||||
@@ -1776,10 +1962,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: popover.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#popovers
|
||||
* Bootstrap: popover.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#popovers
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -1796,7 +1982,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
|
||||
|
||||
Popover.VERSION = '3.3.7'
|
||||
Popover.VERSION = '3.4.1'
|
||||
|
||||
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
|
||||
placement: 'right',
|
||||
@@ -1822,10 +2008,25 @@ if (typeof jQuery === 'undefined') {
|
||||
var title = this.getTitle()
|
||||
var content = this.getContent()
|
||||
|
||||
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
||||
$tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
|
||||
this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
|
||||
](content)
|
||||
if (this.options.html) {
|
||||
var typeContent = typeof content
|
||||
|
||||
if (this.options.sanitize) {
|
||||
title = this.sanitizeHtml(title)
|
||||
|
||||
if (typeContent === 'string') {
|
||||
content = this.sanitizeHtml(content)
|
||||
}
|
||||
}
|
||||
|
||||
$tip.find('.popover-title').html(title)
|
||||
$tip.find('.popover-content').children().detach().end()[
|
||||
typeContent === 'string' ? 'html' : 'append'
|
||||
](content)
|
||||
} else {
|
||||
$tip.find('.popover-title').text(title)
|
||||
$tip.find('.popover-content').children().detach().end().text(content)
|
||||
}
|
||||
|
||||
$tip.removeClass('fade top bottom left right in')
|
||||
|
||||
@@ -1844,8 +2045,8 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
return $e.attr('data-content')
|
||||
|| (typeof o.content == 'function' ?
|
||||
o.content.call($e[0]) :
|
||||
o.content)
|
||||
o.content.call($e[0]) :
|
||||
o.content)
|
||||
}
|
||||
|
||||
Popover.prototype.arrow = function () {
|
||||
@@ -1885,10 +2086,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: scrollspy.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#scrollspy
|
||||
* Bootstrap: scrollspy.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#scrollspy
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -1914,7 +2115,7 @@ if (typeof jQuery === 'undefined') {
|
||||
this.process()
|
||||
}
|
||||
|
||||
ScrollSpy.VERSION = '3.3.7'
|
||||
ScrollSpy.VERSION = '3.4.1'
|
||||
|
||||
ScrollSpy.DEFAULTS = {
|
||||
offset: 10
|
||||
@@ -2058,10 +2259,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: tab.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#tabs
|
||||
* Bootstrap: tab.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#tabs
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -2078,7 +2279,7 @@ if (typeof jQuery === 'undefined') {
|
||||
// jscs:enable requireDollarBeforejQueryAssignment
|
||||
}
|
||||
|
||||
Tab.VERSION = '3.3.7'
|
||||
Tab.VERSION = '3.4.1'
|
||||
|
||||
Tab.TRANSITION_DURATION = 150
|
||||
|
||||
@@ -2107,7 +2308,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
|
||||
|
||||
var $target = $(selector)
|
||||
var $target = $(document).find(selector)
|
||||
|
||||
this.activate($this.closest('li'), $ul)
|
||||
this.activate($target, $target.parent(), function () {
|
||||
@@ -2132,15 +2333,15 @@ if (typeof jQuery === 'undefined') {
|
||||
$active
|
||||
.removeClass('active')
|
||||
.find('> .dropdown-menu > .active')
|
||||
.removeClass('active')
|
||||
.removeClass('active')
|
||||
.end()
|
||||
.find('[data-toggle="tab"]')
|
||||
.attr('aria-expanded', false)
|
||||
.attr('aria-expanded', false)
|
||||
|
||||
element
|
||||
.addClass('active')
|
||||
.find('[data-toggle="tab"]')
|
||||
.attr('aria-expanded', true)
|
||||
.attr('aria-expanded', true)
|
||||
|
||||
if (transition) {
|
||||
element[0].offsetWidth // reflow for transition
|
||||
@@ -2152,10 +2353,10 @@ if (typeof jQuery === 'undefined') {
|
||||
if (element.parent('.dropdown-menu').length) {
|
||||
element
|
||||
.closest('li.dropdown')
|
||||
.addClass('active')
|
||||
.addClass('active')
|
||||
.end()
|
||||
.find('[data-toggle="tab"]')
|
||||
.attr('aria-expanded', true)
|
||||
.attr('aria-expanded', true)
|
||||
}
|
||||
|
||||
callback && callback()
|
||||
@@ -2214,10 +2415,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: affix.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#affix
|
||||
* Bootstrap: affix.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#affix
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -2231,7 +2432,9 @@ if (typeof jQuery === 'undefined') {
|
||||
var Affix = function (element, options) {
|
||||
this.options = $.extend({}, Affix.DEFAULTS, options)
|
||||
|
||||
this.$target = $(this.options.target)
|
||||
var target = this.options.target === Affix.DEFAULTS.target ? $(this.options.target) : $(document).find(this.options.target)
|
||||
|
||||
this.$target = target
|
||||
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
|
||||
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
|
||||
|
||||
@@ -2243,7 +2446,7 @@ if (typeof jQuery === 'undefined') {
|
||||
this.checkPosition()
|
||||
}
|
||||
|
||||
Affix.VERSION = '3.3.7'
|
||||
Affix.VERSION = '3.4.1'
|
||||
|
||||
Affix.RESET = 'affix affix-top affix-bottom'
|
||||
|
||||
9
src/js/casinocoin-util.js
Normal file
9
src/js/casinocoin-util.js
Normal file
@@ -0,0 +1,9 @@
|
||||
function convertCasinoCoinAdrr(address) {
|
||||
return libs.basex('cpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2brdeCg65jkm8oFqi1tuvAxyz').encode(
|
||||
libs.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(address)
|
||||
)
|
||||
}
|
||||
|
||||
function convertCasinoCoinPriv(priv) {
|
||||
return libs.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(priv).toString("hex").slice(2,66)
|
||||
}
|
||||
13
src/js/cosmos-util.js
Normal file
13
src/js/cosmos-util.js
Normal file
@@ -0,0 +1,13 @@
|
||||
function CosmosBufferToPublic(pubBuf, hrp = "cosmos") {
|
||||
const Buffer = libs.buffer.Buffer;
|
||||
const AminoSecp256k1PubkeyPrefix = Buffer.from("EB5AE987", "hex");
|
||||
const AminoSecp256k1PubkeyLength = Buffer.from("21", "hex");
|
||||
pubBuf = Buffer.concat([AminoSecp256k1PubkeyPrefix, AminoSecp256k1PubkeyLength, pubBuf]);
|
||||
return libs.bech32.encode(`${hrp}pub`, libs.bech32.toWords(pubBuf));
|
||||
}
|
||||
|
||||
function CosmosBufferToAddress(pubBuf, hrp = "cosmos") {
|
||||
const sha256_ed = libs.createHash("sha256").update(pubBuf).digest();
|
||||
const ripemd160_ed = libs.createHash("rmd160").update(sha256_ed).digest();
|
||||
return libs.bech32.encode(hrp, libs.bech32.toWords(ripemd160_ed));
|
||||
}
|
||||
@@ -16,7 +16,136 @@
|
||||
|
||||
window.Entropy = new (function() {
|
||||
|
||||
var TWO = new BigInteger(2);
|
||||
let eventBits = {
|
||||
|
||||
"binary": {
|
||||
"0": "0",
|
||||
"1": "1",
|
||||
},
|
||||
|
||||
// log2(6) = 2.58496 bits per roll, with bias
|
||||
// 4 rolls give 2 bits each
|
||||
// 2 rolls give 1 bit each
|
||||
// Average (4*2 + 2*1) / 6 = 1.66 bits per roll without bias
|
||||
"base 6": {
|
||||
"0": "00",
|
||||
"1": "01",
|
||||
"2": "10",
|
||||
"3": "11",
|
||||
"4": "0",
|
||||
"5": "1",
|
||||
},
|
||||
|
||||
// log2(6) = 2.58496 bits per roll, with bias
|
||||
// 4 rolls give 2 bits each
|
||||
// 2 rolls give 1 bit each
|
||||
// Average (4*2 + 2*1) / 6 = 1.66 bits per roll without bias
|
||||
"base 6 (dice)": {
|
||||
"0": "00", // equivalent to 0 in base 6
|
||||
"1": "01",
|
||||
"2": "10",
|
||||
"3": "11",
|
||||
"4": "0",
|
||||
"5": "1",
|
||||
},
|
||||
|
||||
// log2(10) = 3.321928 bits per digit, with bias
|
||||
// 8 digits give 3 bits each
|
||||
// 2 digits give 1 bit each
|
||||
// Average (8*3 + 2*1) / 10 = 2.6 bits per digit without bias
|
||||
"base 10": {
|
||||
"0": "000",
|
||||
"1": "001",
|
||||
"2": "010",
|
||||
"3": "011",
|
||||
"4": "100",
|
||||
"5": "101",
|
||||
"6": "110",
|
||||
"7": "111",
|
||||
"8": "0",
|
||||
"9": "1",
|
||||
},
|
||||
|
||||
"hexadecimal": {
|
||||
"0": "0000",
|
||||
"1": "0001",
|
||||
"2": "0010",
|
||||
"3": "0011",
|
||||
"4": "0100",
|
||||
"5": "0101",
|
||||
"6": "0110",
|
||||
"7": "0111",
|
||||
"8": "1000",
|
||||
"9": "1001",
|
||||
"a": "1010",
|
||||
"b": "1011",
|
||||
"c": "1100",
|
||||
"d": "1101",
|
||||
"e": "1110",
|
||||
"f": "1111",
|
||||
},
|
||||
|
||||
// log2(52) = 5.7004 bits per card, with bias
|
||||
// 32 cards give 5 bits each
|
||||
// 16 cards give 4 bits each
|
||||
// 4 cards give 2 bits each
|
||||
// Average (32*5 + 16*4 + 4*2) / 52 = 4.46 bits per card without bias
|
||||
"card": {
|
||||
"ac": "00000",
|
||||
"2c": "00001",
|
||||
"3c": "00010",
|
||||
"4c": "00011",
|
||||
"5c": "00100",
|
||||
"6c": "00101",
|
||||
"7c": "00110",
|
||||
"8c": "00111",
|
||||
"9c": "01000",
|
||||
"tc": "01001",
|
||||
"jc": "01010",
|
||||
"qc": "01011",
|
||||
"kc": "01100",
|
||||
"ad": "01101",
|
||||
"2d": "01110",
|
||||
"3d": "01111",
|
||||
"4d": "10000",
|
||||
"5d": "10001",
|
||||
"6d": "10010",
|
||||
"7d": "10011",
|
||||
"8d": "10100",
|
||||
"9d": "10101",
|
||||
"td": "10110",
|
||||
"jd": "10111",
|
||||
"qd": "11000",
|
||||
"kd": "11001",
|
||||
"ah": "11010",
|
||||
"2h": "11011",
|
||||
"3h": "11100",
|
||||
"4h": "11101",
|
||||
"5h": "11110",
|
||||
"6h": "11111",
|
||||
"7h": "0000",
|
||||
"8h": "0001",
|
||||
"9h": "0010",
|
||||
"th": "0011",
|
||||
"jh": "0100",
|
||||
"qh": "0101",
|
||||
"kh": "0110",
|
||||
"as": "0111",
|
||||
"2s": "1000",
|
||||
"3s": "1001",
|
||||
"4s": "1010",
|
||||
"5s": "1011",
|
||||
"6s": "1100",
|
||||
"7s": "1101",
|
||||
"8s": "1110",
|
||||
"9s": "1111",
|
||||
"ts": "00",
|
||||
"js": "01",
|
||||
"qs": "10",
|
||||
"ks": "11",
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
// matchers returns an array of the matched events for each type of entropy.
|
||||
// eg
|
||||
@@ -51,48 +180,28 @@ window.Entropy = new (function() {
|
||||
}
|
||||
}
|
||||
|
||||
// Convert array of cards from ["ac", "4d", "ks"]
|
||||
// to numbers between 0 and 51 [0, 16, 51]
|
||||
function convertCardsToInts(cards) {
|
||||
var ints = [];
|
||||
var values = "a23456789tjqk";
|
||||
var suits = "cdhs";
|
||||
for (var i=0; i<cards.length; i++) {
|
||||
var card = cards[i].toLowerCase();
|
||||
var value = card[0];
|
||||
var suit = card[1];
|
||||
var asInt = 13 * suits.indexOf(suit) + values.indexOf(value);
|
||||
ints.push(asInt);
|
||||
}
|
||||
return ints;
|
||||
}
|
||||
|
||||
this.fromString = function(rawEntropyStr) {
|
||||
this.fromString = function(rawEntropyStr, baseStr) {
|
||||
// Find type of entropy being used (binary, hex, dice etc)
|
||||
var base = getBase(rawEntropyStr);
|
||||
var base = getBase(rawEntropyStr, baseStr);
|
||||
// Convert dice to base6 entropy (ie 1-6 to 0-5)
|
||||
// This is done by changing all 6s to 0s
|
||||
if (base.str == "dice") {
|
||||
var newParts = [];
|
||||
var newInts = [];
|
||||
for (var i=0; i<base.parts.length; i++) {
|
||||
var c = base.parts[i];
|
||||
var newEvents = [];
|
||||
for (var i=0; i<base.events.length; i++) {
|
||||
var c = base.events[i];
|
||||
if ("12345".indexOf(c) > -1) {
|
||||
newParts[i] = base.parts[i];
|
||||
newInts[i] = base.ints[i];
|
||||
newEvents[i] = base.events[i];
|
||||
}
|
||||
else {
|
||||
newParts[i] = "0";
|
||||
newInts[i] = 0;
|
||||
newEvents[i] = "0";
|
||||
}
|
||||
}
|
||||
base.str = "base 6 (dice)";
|
||||
base.ints = newInts;
|
||||
base.parts = newParts;
|
||||
base.events = newEvents;
|
||||
base.matcher = matchers.base6;
|
||||
}
|
||||
// Detect empty entropy
|
||||
if (base.parts.length == 0) {
|
||||
if (base.events.length == 0) {
|
||||
return {
|
||||
binaryStr: "",
|
||||
cleanStr: "",
|
||||
@@ -100,44 +209,23 @@ window.Entropy = new (function() {
|
||||
base: base,
|
||||
};
|
||||
}
|
||||
// Convert base.ints to BigInteger.
|
||||
// Due to using unusual bases, eg cards of base52, this is not as simple as
|
||||
// using BigInteger.parse()
|
||||
var entropyInt = BigInteger.ZERO;
|
||||
for (var i=base.ints.length-1; i>=0; i--) {
|
||||
var thisInt = BigInteger.parse(base.ints[i]);
|
||||
var power = (base.ints.length - 1) - i;
|
||||
var additionalEntropy = BigInteger.parse(base.asInt).pow(power).multiply(thisInt);
|
||||
entropyInt = entropyInt.add(additionalEntropy);
|
||||
}
|
||||
// Convert entropy to binary
|
||||
var entropyBin = entropyInt.toString(2);
|
||||
// If the first integer is small, it must be padded with zeros.
|
||||
// Otherwise the chance of the first bit being 1 is 100%, which is
|
||||
// obviously incorrect.
|
||||
// This is not perfect for non-2^n bases.
|
||||
var expectedBits = Math.floor(base.parts.length * Math.log2(base.asInt));
|
||||
while (entropyBin.length < expectedBits) {
|
||||
entropyBin = "0" + entropyBin;
|
||||
}
|
||||
// Calculate the number of bits per event
|
||||
var bitsPerEvent = Math.log2(base.asInt);
|
||||
// Cards binary must be handled differently, since they're not replaced
|
||||
if (base.asInt == 52) {
|
||||
var cardEntropy = processCardEntropy(base.parts);
|
||||
entropyBin = cardEntropy.binaryStr;
|
||||
bitsPerEvent = cardEntropy.bitsPerEvent;
|
||||
}
|
||||
// Convert entropy events to binary
|
||||
var entropyBin = base.events.map(function(e) {
|
||||
return eventBits[base.str][e.toLowerCase()];
|
||||
}).join("");
|
||||
// Get average bits per event
|
||||
// which may be adjusted for bias if log2(base) is fractional
|
||||
var bitsPerEvent = base.bitsPerEvent;
|
||||
// Supply a 'filtered' entropy string for display purposes
|
||||
var entropyClean = base.parts.join("");
|
||||
var entropyHtml = base.parts.join("");
|
||||
var entropyClean = base.events.join("");
|
||||
var entropyHtml = base.events.join("");
|
||||
if (base.asInt == 52) {
|
||||
entropyClean = base.parts.join(" ").toUpperCase();
|
||||
entropyClean = base.events.join(" ").toUpperCase();
|
||||
entropyClean = entropyClean.replace(/C/g, "\u2663");
|
||||
entropyClean = entropyClean.replace(/D/g, "\u2666");
|
||||
entropyClean = entropyClean.replace(/H/g, "\u2665");
|
||||
entropyClean = entropyClean.replace(/S/g, "\u2660");
|
||||
entropyHtml = base.parts.join(" ").toUpperCase();
|
||||
entropyHtml = base.events.join(" ").toUpperCase();
|
||||
entropyHtml = entropyHtml.replace(/C/g, "<span class='card-suit club'>\u2663</span>");
|
||||
entropyHtml = entropyHtml.replace(/D/g, "<span class='card-suit diamond'>\u2666</span>");
|
||||
entropyHtml = entropyHtml.replace(/H/g, "<span class='card-suit heart'>\u2665</span>");
|
||||
@@ -154,192 +242,80 @@ window.Entropy = new (function() {
|
||||
return e;
|
||||
}
|
||||
|
||||
function getSortedDeck() {
|
||||
var s = [];
|
||||
var suits = "CDHS";
|
||||
var values = "A23456789TJQK";
|
||||
for (var i=0; i<suits.length; i++) {
|
||||
for (var j=0; j<values.length; j++) {
|
||||
s.push(values[j]+suits[i]);
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
function getBase(str) {
|
||||
function getBase(str, baseStr) {
|
||||
// Need to get the lowest base for the supplied entropy.
|
||||
// This prevents interpreting, say, dice rolls as hexadecimal.
|
||||
var binaryMatches = matchers.binary(str);
|
||||
var hexMatches = matchers.hex(str);
|
||||
var autodetect = baseStr === undefined;
|
||||
// Find the lowest base that can be used, whilst ignoring any irrelevant chars
|
||||
if (binaryMatches.length == hexMatches.length && hexMatches.length > 0) {
|
||||
if ((binaryMatches.length == hexMatches.length && hexMatches.length > 0 && autodetect) || baseStr === "binary") {
|
||||
var ints = binaryMatches.map(function(i) { return parseInt(i, 2) });
|
||||
return {
|
||||
ints: ints,
|
||||
parts: binaryMatches,
|
||||
events: binaryMatches,
|
||||
matcher: matchers.binary,
|
||||
asInt: 2,
|
||||
bitsPerEvent: 1,
|
||||
str: "binary",
|
||||
}
|
||||
}
|
||||
var cardMatches = matchers.card(str);
|
||||
if (cardMatches.length >= hexMatches.length / 2) {
|
||||
var ints = convertCardsToInts(cardMatches);
|
||||
if ((cardMatches.length >= hexMatches.length / 2 && autodetect) || baseStr === "card") {
|
||||
return {
|
||||
ints: ints,
|
||||
parts: cardMatches,
|
||||
events: cardMatches,
|
||||
matcher: matchers.card,
|
||||
asInt: 52,
|
||||
bitsPerEvent: (32*5 + 16*4 + 4*2) / 52, // see cardBits
|
||||
str: "card",
|
||||
}
|
||||
}
|
||||
var diceMatches = matchers.dice(str);
|
||||
if (diceMatches.length == hexMatches.length && hexMatches.length > 0) {
|
||||
if ((diceMatches.length == hexMatches.length && hexMatches.length > 0 && autodetect) || baseStr === "dice") {
|
||||
var ints = diceMatches.map(function(i) { return parseInt(i) });
|
||||
return {
|
||||
ints: ints,
|
||||
parts: diceMatches,
|
||||
events: diceMatches,
|
||||
matcher: matchers.dice,
|
||||
asInt: 6,
|
||||
bitsPerEvent: (4*2 + 2*1) / 6, // see diceBits
|
||||
str: "dice",
|
||||
}
|
||||
}
|
||||
var base6Matches = matchers.base6(str);
|
||||
if (base6Matches.length == hexMatches.length && hexMatches.length > 0) {
|
||||
if ((base6Matches.length == hexMatches.length && hexMatches.length > 0 && autodetect) || baseStr === "base 6") {
|
||||
var ints = base6Matches.map(function(i) { return parseInt(i) });
|
||||
return {
|
||||
ints: ints,
|
||||
parts: base6Matches,
|
||||
events: base6Matches,
|
||||
matcher: matchers.base6,
|
||||
asInt: 6,
|
||||
bitsPerEvent: (4*2 + 2*1) / 6, // see diceBits
|
||||
str: "base 6",
|
||||
}
|
||||
}
|
||||
var base10Matches = matchers.base10(str);
|
||||
if (base10Matches.length == hexMatches.length && hexMatches.length > 0) {
|
||||
if ((base10Matches.length == hexMatches.length && hexMatches.length > 0 && autodetect) || baseStr === "base 10") {
|
||||
var ints = base10Matches.map(function(i) { return parseInt(i) });
|
||||
return {
|
||||
ints: ints,
|
||||
parts: base10Matches,
|
||||
events: base10Matches,
|
||||
matcher: matchers.base10,
|
||||
asInt: 10,
|
||||
bitsPerEvent: (8*3 + 2*1) / 10, // see b10Bits
|
||||
str: "base 10",
|
||||
}
|
||||
}
|
||||
var ints = hexMatches.map(function(i) { return parseInt(i, 16) });
|
||||
return {
|
||||
ints: ints,
|
||||
parts: hexMatches,
|
||||
events: hexMatches,
|
||||
matcher: matchers.hex,
|
||||
asInt: 16,
|
||||
bitsPerEvent: 4,
|
||||
str: "hexadecimal",
|
||||
}
|
||||
}
|
||||
|
||||
// Assume cards are NOT replaced.
|
||||
// Additional entropy decreases as more cards are used. This means
|
||||
// total possible entropy is measured using n!, not base^n.
|
||||
// eg the second last card can be only one of two, not one of fifty two
|
||||
// so the added entropy for that card is only one bit at most
|
||||
function processCardEntropy(cards) {
|
||||
// Track how many instances of each card have been used, and thus
|
||||
// how many decks are in use.
|
||||
var cardCounts = {};
|
||||
var numberOfDecks = 0;
|
||||
// Work out number of decks by max(duplicates)
|
||||
for (var i=0; i<cards.length; i++) {
|
||||
// Get the card that was drawn
|
||||
var cardLower = cards[i];
|
||||
var card = cardLower.toUpperCase();
|
||||
// Initialize the count for this card if needed
|
||||
if (!(card in cardCounts)) {
|
||||
cardCounts[card] = 0;
|
||||
}
|
||||
cardCounts[card] += 1;
|
||||
// See if this is max(duplicates)
|
||||
if (cardCounts[card] > numberOfDecks) {
|
||||
numberOfDecks = cardCounts[card];
|
||||
}
|
||||
}
|
||||
// Work out the total number of bits for this many decks
|
||||
// See http://crypto.stackexchange.com/q/41886
|
||||
var gainedBits = 0;
|
||||
// Equivalent of Math.log2(factorial(52*numberOfDecks))
|
||||
// which becomes infinity for numberOfDecks > 4
|
||||
for (var i=1; i<=52*numberOfDecks; i++) {
|
||||
gainedBits = gainedBits + Math.log2(i);
|
||||
}
|
||||
var lostBits = 52 * Math.log2(factorial(numberOfDecks));
|
||||
var maxBits = gainedBits - lostBits;
|
||||
// Convert the drawn cards to a binary representation.
|
||||
// The exact technique for doing this is unclear.
|
||||
// See
|
||||
// http://crypto.stackexchange.com/a/41896
|
||||
// "I even doubt that this is well defined (only the average entropy
|
||||
// is, I believe)."
|
||||
// See
|
||||
// https://github.com/iancoleman/bip39/issues/33#issuecomment-263021856
|
||||
// "The binary representation can be the first log(permutations,2) bits
|
||||
// of the sha-2 hash of the normalized deck string."
|
||||
//
|
||||
// In this specific implementation, the first N bits of the hash of the
|
||||
// normalized cards string is being used. Uppercase, no spaces; eg
|
||||
// sha256("AH8DQSTC2H")
|
||||
var totalCards = numberOfDecks * 52;
|
||||
var percentUsed = cards.length / totalCards;
|
||||
// Calculate the average number of bits of entropy for the number of
|
||||
// cards drawn.
|
||||
var numberOfBits = Math.floor(maxBits * percentUsed);
|
||||
// Create a normalized string of the selected cards
|
||||
var normalizedCards = cards.join("").toUpperCase();
|
||||
// Convert to binary using the SHA256 hash of the normalized cards.
|
||||
// If the number of bits is more than 256, multiple hashes
|
||||
// are used until the required number of bits is reached.
|
||||
var entropyBin = "";
|
||||
var iterations = 0;
|
||||
while (entropyBin.length < numberOfBits) {
|
||||
var hashedCards = sjcl.hash.sha256.hash(normalizedCards + ":" + iterations);
|
||||
var hashHex = sjcl.codec.hex.fromBits(hashedCards);
|
||||
for (var i=0; i<hashHex.length; i++) {
|
||||
var decimal = parseInt(hashHex[i], 16);
|
||||
var binary = decimal.toString(2);
|
||||
while (binary.length < 4) {
|
||||
binary = "0" + binary;
|
||||
}
|
||||
entropyBin = entropyBin + binary;
|
||||
}
|
||||
iterations = iterations + 1;
|
||||
}
|
||||
// Truncate to the appropriate number of bits.
|
||||
entropyBin = entropyBin.substring(0, numberOfBits);
|
||||
// Get the number of bits per event
|
||||
bitsPerEvent = maxBits / totalCards;
|
||||
return {
|
||||
binaryStr: entropyBin,
|
||||
bitsPerEvent: bitsPerEvent,
|
||||
}
|
||||
}
|
||||
|
||||
// Polyfill for Math.log2
|
||||
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2#Polyfill
|
||||
Math.log2 = Math.log2 || function(x) {
|
||||
// The polyfill isn't good enough because of the poor accuracy of
|
||||
// Math.LOG2E
|
||||
// log2(8) gave 2.9999999999999996 which when floored causes issues.
|
||||
// So instead use the BigInteger library to get it right.
|
||||
return BigInteger.log(x) / BigInteger.log(2);
|
||||
};
|
||||
|
||||
// Depends on BigInteger
|
||||
function factorial(n) {
|
||||
if (n == 0) {
|
||||
return 1;
|
||||
}
|
||||
f = BigInteger.ONE;
|
||||
for (var i=1; i<=n; i++) {
|
||||
f = f.multiply(new BigInteger(i));
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
17
src/js/eos-util.js
Normal file
17
src/js/eos-util.js
Normal file
@@ -0,0 +1,17 @@
|
||||
function EOSbufferToPublic(pubBuf) {
|
||||
const Buffer = libs.buffer.Buffer;
|
||||
const EOS_PUBLIC_PREFIX = "EOS";
|
||||
let checksum = libs.createHash("rmd160").update(pubBuf).digest("hex").slice(0, 8);
|
||||
pubBuf = Buffer.concat([pubBuf, Buffer.from(checksum, "hex")]);
|
||||
return EOS_PUBLIC_PREFIX.concat(libs.bs58.encode(pubBuf));
|
||||
}
|
||||
|
||||
function EOSbufferToPrivate(privBuf) {
|
||||
const Buffer = libs.buffer.Buffer;
|
||||
const EOS_PRIVATE_PREFIX = "80";
|
||||
privBuf = Buffer.concat([Buffer.from(EOS_PRIVATE_PREFIX, "hex"), privBuf]);
|
||||
let tmp = libs.createHash("sha256").update(privBuf).digest();
|
||||
let checksum = libs.createHash("sha256").update(tmp).digest("hex").slice(0, 8);
|
||||
privBuf = Buffer.concat([privBuf, Buffer.from(checksum, "hex")]);
|
||||
return libs.bs58.encode(privBuf);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
19
src/js/fio-util.js
Normal file
19
src/js/fio-util.js
Normal file
@@ -0,0 +1,19 @@
|
||||
function FIObufferToPublic(pubBuf) {
|
||||
const Buffer = libs.buffer.Buffer;
|
||||
const FIO_PUBLIC_PREFIX = "FIO";
|
||||
|
||||
let checksum = libs.createHash("rmd160").update(pubBuf).digest("hex").slice(0, 8);
|
||||
pubBuf = Buffer.concat([pubBuf, Buffer.from(checksum, "hex")]);
|
||||
return FIO_PUBLIC_PREFIX.concat(libs.bs58.encode(pubBuf));
|
||||
}
|
||||
|
||||
function FIObufferToPrivate(privBuf) {
|
||||
const Buffer = libs.buffer.Buffer;
|
||||
const FIO_PRIVATE_PREFIX = "80";
|
||||
|
||||
privBuf = Buffer.concat([Buffer.from(FIO_PRIVATE_PREFIX, "hex"), privBuf]);
|
||||
let tmp = libs.createHash("sha256").update(privBuf).digest();
|
||||
let checksum = libs.createHash("sha256").update(tmp).digest("hex").slice(0, 8);
|
||||
privBuf = Buffer.concat([privBuf, Buffer.from(checksum, "hex")]);
|
||||
return libs.bs58.encode(privBuf);
|
||||
}
|
||||
1609
src/js/index.js
1609
src/js/index.js
File diff suppressed because it is too large
Load Diff
10
src/js/jingtum-util.js
Normal file
10
src/js/jingtum-util.js
Normal file
@@ -0,0 +1,10 @@
|
||||
function convertJingtumAdrr(address) {
|
||||
return libs.basex('jpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65rkm8oFqi1tuvAxyz').encode(
|
||||
libs.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(address)
|
||||
)
|
||||
}
|
||||
|
||||
function convertJingtumPriv(priv) {
|
||||
return libs.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(priv).toString("hex").slice(2,66)
|
||||
}
|
||||
|
||||
@@ -28,7 +28,9 @@
|
||||
|
||||
var Mnemonic = function(language) {
|
||||
|
||||
var PBKDF2_ROUNDS = 2048;
|
||||
var DOM = {};
|
||||
DOM.entropyContainer = $(".entropy-container");
|
||||
PBKDF2_ROUNDS = DOM.entropyContainer.find(".pbkdf2-rounds").val();
|
||||
var RADIX = 2048;
|
||||
|
||||
var self = this;
|
||||
@@ -97,22 +99,10 @@ var Mnemonic = function(language) {
|
||||
}
|
||||
|
||||
self.check = function(mnemonic) {
|
||||
var mnemonic = self.splitWords(mnemonic);
|
||||
if (mnemonic.length == 0 || mnemonic.length % 3 > 0) {
|
||||
return false
|
||||
var b = mnemonicToBinaryString(mnemonic);
|
||||
if (b === null) {
|
||||
return false;
|
||||
}
|
||||
// idx = map(lambda x: bin(self.wordlist.index(x))[2:].zfill(11), mnemonic)
|
||||
var idx = [];
|
||||
for (var i=0; i<mnemonic.length; i++) {
|
||||
var word = mnemonic[i];
|
||||
var wordIndex = wordlist.indexOf(word);
|
||||
if (wordIndex == -1) {
|
||||
return false;
|
||||
}
|
||||
var binaryIndex = zfill(wordIndex.toString(2), 11);
|
||||
idx.push(binaryIndex);
|
||||
}
|
||||
var b = idx.join('');
|
||||
var l = b.length;
|
||||
//d = b[:l / 33 * 32]
|
||||
//h = b[-l / 33:]
|
||||
@@ -128,6 +118,26 @@ var Mnemonic = function(language) {
|
||||
return h == nh;
|
||||
}
|
||||
|
||||
self.toRawEntropyHex = function(mnemonic) {
|
||||
var b = mnemonicToBinaryString(mnemonic);
|
||||
if (b === null)
|
||||
return null;
|
||||
var d = b.substring(0, b.length / 33 * 32);
|
||||
var nd = binaryStringToWordArray(d);
|
||||
|
||||
var h = "";
|
||||
for (var i=0; i<nd.length; i++) {
|
||||
h += ('0000000' + nd[i].toString(16)).slice(-8);
|
||||
}
|
||||
return h;
|
||||
}
|
||||
|
||||
self.toRawEntropyBin = function(mnemonic) {
|
||||
var b = mnemonicToBinaryString(mnemonic);
|
||||
var d = b.substring(0, b.length / 33 * 32);
|
||||
return d;
|
||||
}
|
||||
|
||||
self.toSeed = function(mnemonic, passphrase) {
|
||||
passphrase = passphrase || '';
|
||||
mnemonic = self.joinWords(self.splitWords(mnemonic)); // removes duplicate blanks
|
||||
@@ -200,6 +210,25 @@ var Mnemonic = function(language) {
|
||||
return a;
|
||||
}
|
||||
|
||||
function mnemonicToBinaryString(mnemonic) {
|
||||
var mnemonic = self.splitWords(mnemonic);
|
||||
if (mnemonic.length == 0 || mnemonic.length % 3 > 0) {
|
||||
return null;
|
||||
}
|
||||
// idx = map(lambda x: bin(self.wordlist.index(x))[2:].zfill(11), mnemonic)
|
||||
var idx = [];
|
||||
for (var i=0; i<mnemonic.length; i++) {
|
||||
var word = mnemonic[i];
|
||||
var wordIndex = wordlist.indexOf(word);
|
||||
if (wordIndex == -1) {
|
||||
return null;
|
||||
}
|
||||
var binaryIndex = zfill(wordIndex.toString(2), 11);
|
||||
idx.push(binaryIndex);
|
||||
}
|
||||
return idx.join('');
|
||||
}
|
||||
|
||||
// Pad a numeric string on the left with zero digits until the given width
|
||||
// is reached.
|
||||
// Note this differs to the python implementation because it does not
|
||||
|
||||
2
src/js/kjua-0.1.1.min.js
vendored
2
src/js/kjua-0.1.1.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,211 +0,0 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Extend an Object with another Object's properties.
|
||||
*
|
||||
* The source objects are specified as additional arguments.
|
||||
*
|
||||
* @param dst Object the object to extend.
|
||||
*
|
||||
* @return Object the final object.
|
||||
*/
|
||||
var _extend = function(dst) {
|
||||
var sources = Array.prototype.slice.call(arguments, 1);
|
||||
for (var i=0; i<sources.length; ++i) {
|
||||
var src = sources[i];
|
||||
for (var p in src) {
|
||||
if (src.hasOwnProperty(p)) dst[p] = src[p];
|
||||
}
|
||||
}
|
||||
return dst;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Defer execution of given function.
|
||||
* @param {Function} func
|
||||
*/
|
||||
var _defer = function(func) {
|
||||
if (typeof setImmediate === 'function') {
|
||||
return setImmediate(func);
|
||||
} else {
|
||||
return setTimeout(func, 0);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Based on the algorithm at http://en.wikipedia.org/wiki/Levenshtein_distance.
|
||||
*/
|
||||
var Levenshtein = {
|
||||
/**
|
||||
* Calculate levenshtein distance of the two strings.
|
||||
*
|
||||
* @param str1 String the first string.
|
||||
* @param str2 String the second string.
|
||||
* @return Integer the levenshtein distance (0 and above).
|
||||
*/
|
||||
get: function(str1, str2) {
|
||||
// base cases
|
||||
if (str1 === str2) return 0;
|
||||
if (str1.length === 0) return str2.length;
|
||||
if (str2.length === 0) return str1.length;
|
||||
|
||||
// two rows
|
||||
var prevRow = new Array(str2.length + 1),
|
||||
curCol, nextCol, i, j, tmp;
|
||||
|
||||
// initialise previous row
|
||||
for (i=0; i<prevRow.length; ++i) {
|
||||
prevRow[i] = i;
|
||||
}
|
||||
|
||||
// calculate current row distance from previous row
|
||||
for (i=0; i<str1.length; ++i) {
|
||||
nextCol = i + 1;
|
||||
|
||||
for (j=0; j<str2.length; ++j) {
|
||||
curCol = nextCol;
|
||||
|
||||
// substution
|
||||
nextCol = prevRow[j] + ( (str1.charAt(i) === str2.charAt(j)) ? 0 : 1 );
|
||||
// insertion
|
||||
tmp = curCol + 1;
|
||||
if (nextCol > tmp) {
|
||||
nextCol = tmp;
|
||||
}
|
||||
// deletion
|
||||
tmp = prevRow[j + 1] + 1;
|
||||
if (nextCol > tmp) {
|
||||
nextCol = tmp;
|
||||
}
|
||||
|
||||
// copy current col value into previous (in preparation for next iteration)
|
||||
prevRow[j] = curCol;
|
||||
}
|
||||
|
||||
// copy last col value into previous (in preparation for next iteration)
|
||||
prevRow[j] = nextCol;
|
||||
}
|
||||
|
||||
return nextCol;
|
||||
},
|
||||
|
||||
/**
|
||||
* Asynchronously calculate levenshtein distance of the two strings.
|
||||
*
|
||||
* @param str1 String the first string.
|
||||
* @param str2 String the second string.
|
||||
* @param cb Function callback function with signature: function(Error err, int distance)
|
||||
* @param [options] Object additional options.
|
||||
* @param [options.progress] Function progress callback with signature: function(percentComplete)
|
||||
*/
|
||||
getAsync: function(str1, str2, cb, options) {
|
||||
options = _extend({}, {
|
||||
progress: null
|
||||
}, options);
|
||||
|
||||
// base cases
|
||||
if (str1 === str2) return cb(null, 0);
|
||||
if (str1.length === 0) return cb(null, str2.length);
|
||||
if (str2.length === 0) return cb(null, str1.length);
|
||||
|
||||
// two rows
|
||||
var prevRow = new Array(str2.length + 1),
|
||||
curCol, nextCol,
|
||||
i, j, tmp,
|
||||
startTime, currentTime;
|
||||
|
||||
// initialise previous row
|
||||
for (i=0; i<prevRow.length; ++i) {
|
||||
prevRow[i] = i;
|
||||
}
|
||||
|
||||
nextCol = 1;
|
||||
i = 0;
|
||||
j = -1;
|
||||
|
||||
var __calculate = function() {
|
||||
// reset timer
|
||||
startTime = new Date().valueOf();
|
||||
currentTime = startTime;
|
||||
|
||||
// keep going until one second has elapsed
|
||||
while (currentTime - startTime < 1000) {
|
||||
// reached end of current row?
|
||||
if (str2.length <= (++j)) {
|
||||
// copy current into previous (in preparation for next iteration)
|
||||
prevRow[j] = nextCol;
|
||||
|
||||
// if already done all chars
|
||||
if (str1.length <= (++i)) {
|
||||
return cb(null, nextCol);
|
||||
}
|
||||
// else if we have more left to do
|
||||
else {
|
||||
nextCol = i + 1;
|
||||
j = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// calculation
|
||||
curCol = nextCol;
|
||||
|
||||
// substution
|
||||
nextCol = prevRow[j] + ( (str1.charAt(i) === str2.charAt(j)) ? 0 : 1 );
|
||||
// insertion
|
||||
tmp = curCol + 1;
|
||||
if (nextCol > tmp) {
|
||||
nextCol = tmp;
|
||||
}
|
||||
// deletion
|
||||
tmp = prevRow[j + 1] + 1;
|
||||
if (nextCol > tmp) {
|
||||
nextCol = tmp;
|
||||
}
|
||||
|
||||
// copy current into previous (in preparation for next iteration)
|
||||
prevRow[j] = curCol;
|
||||
|
||||
// get current time
|
||||
currentTime = new Date().valueOf();
|
||||
}
|
||||
|
||||
// send a progress update?
|
||||
if (null !== options.progress) {
|
||||
try {
|
||||
options.progress.call(null, (i * 100.0/ str1.length));
|
||||
} catch (err) {
|
||||
return cb('Progress callback: ' + err.toString());
|
||||
}
|
||||
}
|
||||
|
||||
// next iteration
|
||||
_defer(__calculate);
|
||||
};
|
||||
|
||||
__calculate();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// amd
|
||||
if (typeof define !== "undefined" && define !== null && define.amd) {
|
||||
define(function() {
|
||||
return Levenshtein;
|
||||
});
|
||||
}
|
||||
// commonjs
|
||||
else if (typeof module !== "undefined" && module !== null && typeof exports !== "undefined" && module.exports === exports) {
|
||||
module.exports = Levenshtein;
|
||||
}
|
||||
// web worker
|
||||
else if (typeof self !== "undefined" && typeof self.postMessage === 'function' && typeof self.importScripts === 'function') {
|
||||
self.Levenshtein = Levenshtein;
|
||||
}
|
||||
// browser main thread
|
||||
else if (typeof window !== "undefined" && window !== null) {
|
||||
window.Levenshtein = Levenshtein;
|
||||
}
|
||||
}());
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,10 @@
|
||||
function convertRippleAdrr(address) {
|
||||
return window.basex('rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz').encode(
|
||||
window.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(address)
|
||||
return libs.basex('rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz').encode(
|
||||
libs.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(address)
|
||||
)
|
||||
}
|
||||
|
||||
function convertRipplePriv(priv) {
|
||||
return window.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(priv).toString("hex").slice(2,66)
|
||||
}
|
||||
|
||||
return libs.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(priv).toString("hex").slice(2,66)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
// p2wpkh
|
||||
|
||||
bitcoinjs.bitcoin.networks.bitcoin.p2wpkh = {
|
||||
libs.bitcoin.networks.bitcoin.p2wpkh = {
|
||||
baseNetwork: "bitcoin",
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bech32: 'bc',
|
||||
@@ -15,7 +15,7 @@ bitcoinjs.bitcoin.networks.bitcoin.p2wpkh = {
|
||||
wif: 0x80
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.testnet.p2wpkh = {
|
||||
libs.bitcoin.networks.testnet.p2wpkh = {
|
||||
baseNetwork: "testnet",
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bech32: 'tb',
|
||||
@@ -28,9 +28,22 @@ bitcoinjs.bitcoin.networks.testnet.p2wpkh = {
|
||||
wif: 0xef
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.regtest.p2wpkh = {
|
||||
baseNetwork: "regtest",
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bech32: 'bcrt',
|
||||
bip32: {
|
||||
public: 0x045f1cf6,
|
||||
private: 0x045f18bc
|
||||
},
|
||||
pubKeyHash: 0x6f,
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xef
|
||||
};
|
||||
|
||||
// p2wpkh in p2sh
|
||||
|
||||
bitcoinjs.bitcoin.networks.bitcoin.p2wpkhInP2sh = {
|
||||
libs.bitcoin.networks.bitcoin.p2wpkhInP2sh = {
|
||||
baseNetwork: "bitcoin",
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bech32: 'bc',
|
||||
@@ -43,7 +56,7 @@ bitcoinjs.bitcoin.networks.bitcoin.p2wpkhInP2sh = {
|
||||
wif: 0x80
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.testnet.p2wpkhInP2sh = {
|
||||
libs.bitcoin.networks.testnet.p2wpkhInP2sh = {
|
||||
baseNetwork: "testnet",
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bech32: 'tb',
|
||||
@@ -56,7 +69,132 @@ bitcoinjs.bitcoin.networks.testnet.p2wpkhInP2sh = {
|
||||
wif: 0xef
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.litecoin.p2wpkh = {
|
||||
libs.bitcoin.networks.regtest.p2wpkhInP2sh = {
|
||||
baseNetwork: "regtest",
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bech32: 'bcrt',
|
||||
bip32: {
|
||||
public: 0x044a5262,
|
||||
private: 0x044a4e28
|
||||
},
|
||||
pubKeyHash: 0x6f,
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xef
|
||||
};
|
||||
|
||||
// p2wsh
|
||||
|
||||
libs.bitcoin.networks.bitcoin.p2wsh = {
|
||||
baseNetwork: "bitcoin",
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bech32: 'bc',
|
||||
bip32: {
|
||||
public: 0x02aa7ed3,
|
||||
private: 0x02aa7a99
|
||||
},
|
||||
pubKeyHash: 0x00,
|
||||
scriptHash: 0x05,
|
||||
wif: 0x80
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.testnet.p2wsh = {
|
||||
baseNetwork: "testnet",
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bech32: 'tb',
|
||||
bip32: {
|
||||
public: 0x02575483,
|
||||
private: 0x02575048
|
||||
},
|
||||
pubKeyHash: 0x6f,
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xef
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.regtest.p2wsh = {
|
||||
baseNetwork: "regtest",
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bech32: 'bcrt',
|
||||
bip32: {
|
||||
public: 0x02575483,
|
||||
private: 0x02575048
|
||||
},
|
||||
pubKeyHash: 0x6f,
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xef
|
||||
};
|
||||
|
||||
// p2wsh in p2sh
|
||||
|
||||
libs.bitcoin.networks.bitcoin.p2wshInP2sh = {
|
||||
baseNetwork: "bitcoin",
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bech32: 'bc',
|
||||
bip32: {
|
||||
public: 0x0295b43f,
|
||||
private: 0x0295b005
|
||||
},
|
||||
pubKeyHash: 0x00,
|
||||
scriptHash: 0x05,
|
||||
wif: 0x80
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.testnet.p2wshInP2sh = {
|
||||
baseNetwork: "testnet",
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bech32: 'tb',
|
||||
bip32: {
|
||||
public: 0x024289ef,
|
||||
private: 0x024285b5
|
||||
},
|
||||
pubKeyHash: 0x6f,
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xef
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.regtest.p2wshInP2sh = {
|
||||
baseNetwork: "regtest",
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bech32: 'bcrt',
|
||||
bip32: {
|
||||
public: 0x024289ef,
|
||||
private: 0x024285b5
|
||||
},
|
||||
pubKeyHash: 0x6f,
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xef
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.cranepay.p2wpkhInP2sh = {
|
||||
baseNetwork: "cranepay",
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bech32: 'cp',
|
||||
bip32: {
|
||||
public: 0x049d7cb2,
|
||||
private: 0x049d7878
|
||||
},
|
||||
pubKeyHash: 28,
|
||||
scriptHash: 10,
|
||||
wif: 123
|
||||
};
|
||||
|
||||
// bech32
|
||||
libs.bitcoin.networks.cranepay.p2wpkh = {
|
||||
baseNetwork: "cranepay",
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bech32: 'cp',
|
||||
bip32: {
|
||||
public: 0x04b24746,
|
||||
private: 0x04b2430c
|
||||
},
|
||||
pubKeyHash: 28,
|
||||
scriptHash: 10,
|
||||
wif: 123
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
libs.bitcoin.networks.litecoin.p2wpkh = {
|
||||
baseNetwork: "litecoin",
|
||||
messagePrefix: '\x19Litecoin Signed Message:\n',
|
||||
bech32: 'ltc',
|
||||
@@ -69,7 +207,7 @@ bitcoinjs.bitcoin.networks.litecoin.p2wpkh = {
|
||||
wif: 0xb0
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.litecoin.p2wpkhInP2sh = {
|
||||
libs.bitcoin.networks.litecoin.p2wpkhInP2sh = {
|
||||
baseNetwork: "litecoin",
|
||||
messagePrefix: '\x19Litecoin Signed Message:\n',
|
||||
bech32: 'ltc',
|
||||
@@ -82,7 +220,7 @@ bitcoinjs.bitcoin.networks.litecoin.p2wpkhInP2sh = {
|
||||
wif: 0xb0
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.fujicoin.p2wpkh = {
|
||||
libs.bitcoin.networks.fujicoin.p2wpkh = {
|
||||
baseNetwork: "fujicoin",
|
||||
messagePrefix: '\x19FujiCoin Signed Message:\n',
|
||||
bech32: 'fc',
|
||||
@@ -95,7 +233,7 @@ bitcoinjs.bitcoin.networks.fujicoin.p2wpkh = {
|
||||
wif: 0xa4
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.fujicoin.p2wpkhInP2sh = {
|
||||
libs.bitcoin.networks.fujicoin.p2wpkhInP2sh = {
|
||||
baseNetwork: "fujicoin",
|
||||
messagePrefix: '\x19FujiCoin Signed Message:\n',
|
||||
bech32: 'fc',
|
||||
@@ -108,7 +246,7 @@ bitcoinjs.bitcoin.networks.fujicoin.p2wpkhInP2sh = {
|
||||
wif: 0xa4
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.vertcoin.p2wpkh = {
|
||||
libs.bitcoin.networks.vertcoin.p2wpkh = {
|
||||
baseNetwork: "vertcoin",
|
||||
messagePrefix: '\x18Vertcoin Signed Message:\n',
|
||||
bech32: 'vtc',
|
||||
@@ -121,7 +259,7 @@ bitcoinjs.bitcoin.networks.vertcoin.p2wpkh = {
|
||||
wif: 0x80
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.vertcoin.p2wpkhInP2sh = {
|
||||
libs.bitcoin.networks.vertcoin.p2wpkhInP2sh = {
|
||||
baseNetwork: "vertcoin",
|
||||
messagePrefix: '\x18Vertcoin Signed Message:\n',
|
||||
bip32: {
|
||||
@@ -133,7 +271,7 @@ bitcoinjs.bitcoin.networks.vertcoin.p2wpkhInP2sh = {
|
||||
wif: 0x80
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.bgold.p2wpkh = {
|
||||
libs.bitcoin.networks.bgold.p2wpkh = {
|
||||
baseNetwork: "bgold",
|
||||
messagePrefix: '\x1DBitcoin Gold Signed Message:\n',
|
||||
bech32: 'btg',
|
||||
@@ -146,7 +284,7 @@ bitcoinjs.bitcoin.networks.bgold.p2wpkh = {
|
||||
wif: 0x80,
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.bgold.p2wpkhInP2sh = {
|
||||
libs.bitcoin.networks.bgold.p2wpkhInP2sh = {
|
||||
baseNetwork: "bgold",
|
||||
messagePrefix: '\x1DBitcoin Gold Signed Message:\n',
|
||||
bech32: 'btg',
|
||||
@@ -159,33 +297,33 @@ bitcoinjs.bitcoin.networks.bgold.p2wpkhInP2sh = {
|
||||
wif: 0x80,
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.digibyte.p2wpkh = {
|
||||
libs.bitcoin.networks.digibyte.p2wpkh = {
|
||||
baseNetwork: "digibyte",
|
||||
messagePrefix: '\x18DigiByte Signed Message:\n',
|
||||
messagePrefix: 'x19DigiByte Signed Message:\n',
|
||||
bech32: 'dgb',
|
||||
bip32: {
|
||||
public: 0x0488B21E,
|
||||
private: 0x0488ADE4
|
||||
public: 0x04b24746,
|
||||
private: 0x04b2430c
|
||||
},
|
||||
pubKeyHash: 0x1e,
|
||||
scriptHash: 0x3f,
|
||||
wif: 0x80
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.digibyte.p2wpkhInP2sh = {
|
||||
baseNetwork: "digibyte",
|
||||
messagePrefix: '\x18DigiByte Signed Message:\n',
|
||||
libs.bitcoin.networks.digibyte.p2wpkhInP2sh = {
|
||||
baseNetwork: "digibyte",
|
||||
messagePrefix: '\x19DigiByte Signed Message:\n',
|
||||
bech32: 'dgb',
|
||||
bip32: {
|
||||
public: 0x0488B21E,
|
||||
private: 0x0488ADE4
|
||||
public: 0x049d7cb2,
|
||||
private: 0x049d7878
|
||||
},
|
||||
pubKeyHash: 0x1e,
|
||||
scriptHash: 0x3f,
|
||||
wif: 0x80
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.blockstamp.p2wpkh = {
|
||||
libs.bitcoin.networks.blockstamp.p2wpkh = {
|
||||
baseNetwork: "blockstamp",
|
||||
messagePrefix: '\x18BlockStamp Signed Message:\n',
|
||||
bech32: 'bc',
|
||||
@@ -198,8 +336,8 @@ bitcoinjs.bitcoin.networks.blockstamp.p2wpkh = {
|
||||
wif: 0x80,
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.blockstamp.p2wpkhInP2sh = {
|
||||
baseNetwork: "blockstamp",
|
||||
libs.bitcoin.networks.blockstamp.p2wpkhInP2sh = {
|
||||
baseNetwork: "blockstamp",
|
||||
messagePrefix: '\x18BlockStamp Signed Message:\n',
|
||||
bech32: 'bc',
|
||||
bip32: {
|
||||
@@ -210,4 +348,421 @@ bitcoinjs.bitcoin.networks.blockstamp.p2wpkhInP2sh = {
|
||||
scriptHash: 0x05,
|
||||
wif: 0x80,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.nix.p2wpkh = {
|
||||
baseNetwork: "nix",
|
||||
messagePrefix: '\x18Nix Signed Message:\n',
|
||||
bech32: 'nix',
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488ade4,
|
||||
},
|
||||
pubKeyHash: 0x26,
|
||||
scriptHash: 0x35,
|
||||
wif: 0x80,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.nix.p2wpkhInP2sh = {
|
||||
baseNetwork: "nix",
|
||||
messagePrefix: '\x18Nix Signed Message:\n',
|
||||
bech32: 'nix',
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488ade4,
|
||||
},
|
||||
pubKeyHash: 0x26,
|
||||
scriptHash: 0x35,
|
||||
wif: 0x80,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.cpuchain.p2wpkh = {
|
||||
baseNetwork: "cpuchain",
|
||||
messagePrefix: '\x1DCPUchain Signed Message:\n',
|
||||
bech32: 'cpu',
|
||||
bip32: {
|
||||
public: 0x04b24746,
|
||||
private: 0x04b2430c
|
||||
},
|
||||
pubKeyHash: 0x1c,
|
||||
scriptHash: 0x1e,
|
||||
wif: 0x80,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.cpuchain.p2wpkhInP2sh = {
|
||||
baseNetwork: "cpuchain",
|
||||
messagePrefix: '\x1DCPUchain Signed Message:\n',
|
||||
bech32: 'cpu',
|
||||
bip32: {
|
||||
public: 0x049d7cb2,
|
||||
private: 0x049d7878
|
||||
},
|
||||
pubKeyHash: 0x1c,
|
||||
scriptHash: 0x1e,
|
||||
wif: 0x80,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.monkeyproject.p2wpkh = {
|
||||
baseNetwork: "monkeyproject",
|
||||
messagePrefix: 'Monkey Signed Message:\n',
|
||||
bech32: 'monkey',
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488dde4
|
||||
},
|
||||
pubKeyHash: 0x33,
|
||||
scriptHash: 0x1c,
|
||||
wif: 0x37
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.monkeyproject.p2wpkhInP2sh = {
|
||||
baseNetwork: "monkeyproject",
|
||||
messagePrefix: 'Monkey Signed Message:\n',
|
||||
bech32: 'monkey',
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488dde4
|
||||
},
|
||||
pubKeyHash: 0x33,
|
||||
scriptHash: 0x1c,
|
||||
wif: 0x37
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.atom.p2wpkh = {
|
||||
baseNetwork: "atom",
|
||||
messagePrefix: '\x18Bitcoin Atom Signed Message:\n',
|
||||
bech32: 'atom',
|
||||
bip32: {
|
||||
public: 0x0488B21E,
|
||||
private: 0x0488ADE4
|
||||
},
|
||||
pubKeyHash: 0x17,
|
||||
scriptHash: 0x0a,
|
||||
wif: 0x80
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.atom.p2wpkhInP2sh = {
|
||||
baseNetwork: "atom",
|
||||
messagePrefix: '\x18Bitcoin Atom Signed Message:\n',
|
||||
bech32: 'atom',
|
||||
bip32: {
|
||||
public: 0x0488B21E,
|
||||
private: 0x0488ADE4
|
||||
},
|
||||
pubKeyHash: 0x17,
|
||||
scriptHash: 0x0a,
|
||||
wif: 0x80
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.bitcore.p2wpkh = {
|
||||
baseNetwork: "bitcore",
|
||||
messagePrefix: '\x18BitCore Signed Message:\n',
|
||||
bech32: 'bitcore',
|
||||
bip32: {
|
||||
public: 0x0488B21E,
|
||||
private: 0x0488ADE4
|
||||
},
|
||||
pubKeyHash: 0x03,
|
||||
scriptHash: 0x7D,
|
||||
wif: 0x80
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.bitcore.p2wpkhInP2sh = {
|
||||
baseNetwork: "bitcore",
|
||||
messagePrefix: '\x18BitCore Signed Message:\n',
|
||||
bech32: 'bitcore',
|
||||
bip32: {
|
||||
public: 0x0488B21E,
|
||||
private: 0x0488ADE4
|
||||
},
|
||||
pubKeyHash: 0x03,
|
||||
scriptHash: 0x7D,
|
||||
wif: 0x80
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.monacoin.p2wpkh = {
|
||||
baseNetwork: "monacoin",
|
||||
messagePrefix: '\x18Monacoin Signed Message:\n',
|
||||
bech32: 'mona',
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488ade4
|
||||
},
|
||||
pubKeyHash: 0x32,
|
||||
scriptHash: 0x37,
|
||||
wif: 0xb0
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.monacoin.p2wpkhInP2sh = {
|
||||
baseNetwork: "monacoin",
|
||||
messagePrefix: '\x18Monacoin Signed Message:\n',
|
||||
bech32: 'mona',
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488ade4
|
||||
},
|
||||
pubKeyHash: 0x32,
|
||||
scriptHash: 0x37,
|
||||
wif: 0xb0
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.syscoin.p2wpkh = {
|
||||
baseNetwork: "syscoin",
|
||||
messagePrefix: '\x18Syscoin Signed Message:\n',
|
||||
bech32: 'sys',
|
||||
bip32: {
|
||||
public: 0x04b24746,
|
||||
private: 0x04b2430c
|
||||
},
|
||||
pubKeyHash: 0x3f,
|
||||
scriptHash: 0x05,
|
||||
wif: 0x80
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.syscoin.p2wpkhInP2sh = {
|
||||
baseNetwork: "syscoin",
|
||||
messagePrefix: '\x18Syscoin Signed Message:\n',
|
||||
bech32: 'sys',
|
||||
bip32: {
|
||||
public: 0x049d7cb2,
|
||||
private: 0x049d7878
|
||||
},
|
||||
pubKeyHash: 0x3f,
|
||||
scriptHash: 0x05,
|
||||
wif: 0x80
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.viacoin.p2wpkh = {
|
||||
baseNetwork: "viacoin",
|
||||
messagePrefix: '\x18Viacoin Signed Message:\n',
|
||||
bech32: 'viacoin',
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488ade4
|
||||
},
|
||||
pubKeyHash: 0x47,
|
||||
scriptHash: 0x21,
|
||||
wif: 0xc7
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.viacoin.p2wpkhInP2sh = {
|
||||
baseNetwork: "viacoin",
|
||||
messagePrefix: '\x18Viacoin Signed Message:\n',
|
||||
bech32: 'viacoin',
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488ade4
|
||||
},
|
||||
pubKeyHash: 0x47,
|
||||
scriptHash: 0x21,
|
||||
wif: 0xc7
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.dogecointestnet.p2wpkh = {
|
||||
baseNetwork: "dogecointestnet",
|
||||
messagePrefix: '\x19Dogecoin Signed Message:\n',
|
||||
bech32: 'dogecointestnet',
|
||||
bip32: {
|
||||
public: 0x043587cf,
|
||||
private: 0x04358394
|
||||
},
|
||||
pubKeyHash: 0x71,
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xf1
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.dogecointestnet.p2wpkhInP2sh = {
|
||||
baseNetwork: "dogecointestnet",
|
||||
messagePrefix: '\x19Dogecoin Signed Message:\n',
|
||||
bech32: 'dogecointestnet',
|
||||
bip32: {
|
||||
public: 0x043587cf,
|
||||
private: 0x04358394
|
||||
},
|
||||
pubKeyHash: 0x71,
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xf1
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.dogecointestnet.p2wpkh = {
|
||||
baseNetwork: "dogecointestnet",
|
||||
messagePrefix: '\x19Dogecoin Signed Message:\n',
|
||||
bech32: 'dogecointestnet',
|
||||
bip32: {
|
||||
public: 0x043587cf,
|
||||
private: 0x04358394
|
||||
},
|
||||
pubKeyHash: 0x71,
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xf1
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.dogecointestnet.p2wpkhInP2sh = {
|
||||
baseNetwork: "dogecointestnet",
|
||||
messagePrefix: '\x19Dogecoin Signed Message:\n',
|
||||
bech32: 'dogecointestnet',
|
||||
bip32: {
|
||||
public: 0x043587cf,
|
||||
private: 0x04358394
|
||||
},
|
||||
pubKeyHash: 0x71,
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xf1
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.litecointestnet.p2wpkh = {
|
||||
baseNetwork: "litecointestnet",
|
||||
messagePrefix: '\x18Litecoin Signed Message:\n',
|
||||
bech32: 'litecointestnet',
|
||||
bip32: {
|
||||
public: 0x043587cf,
|
||||
private: 0x04358394
|
||||
},
|
||||
pubKeyHash: 0x6f,
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xef
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.litecointestnet.p2wpkhInP2sh = {
|
||||
baseNetwork: "litecointestnet",
|
||||
messagePrefix: '\x18Litecoin Signed Message:\n',
|
||||
bech32: 'litecointestnet',
|
||||
bip32: {
|
||||
public: 0x043587cf,
|
||||
private: 0x04358394
|
||||
},
|
||||
pubKeyHash: 0x6f,
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xef
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.groestlcoin.p2wpkh = {
|
||||
baseNetwork: "groestlcoin",
|
||||
messagePrefix: '\x19GroestlCoin Signed Message:\n',
|
||||
bech32: 'grs',
|
||||
bip32: {
|
||||
public: 0x04b24746,
|
||||
private: 0x04b2430c
|
||||
},
|
||||
pubKeyHash: 0x24,
|
||||
scriptHash: 0x05,
|
||||
wif: 0x80,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.groestlcointestnet.p2wpkh = {
|
||||
baseNetwork: "groestlcointestnet",
|
||||
messagePrefix: '\x19GroestlCoin Signed Message:\n',
|
||||
bech32: 'tgrs',
|
||||
bip32: {
|
||||
public: 0x045f1cf6,
|
||||
private: 0x045f18bc
|
||||
},
|
||||
pubKeyHash: 0x6f,
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xef
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.groestlcoin.p2wpkhInP2sh = {
|
||||
baseNetwork: "groestlcoin",
|
||||
messagePrefix: '\x19GroestlCoin Signed Message:\n',
|
||||
bech32: 'grs',
|
||||
bip32: {
|
||||
public: 0x049d7cb2,
|
||||
private: 0x049d7878
|
||||
},
|
||||
pubKeyHash: 0x24,
|
||||
scriptHash: 0x05,
|
||||
wif: 0x80,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.groestlcointestnet.p2wpkhInP2sh = {
|
||||
baseNetwork: "groestlcointestnet",
|
||||
messagePrefix: '\x19GroestlCoin Signed Message:\n',
|
||||
bech32: 'tgrs',
|
||||
bip32: {
|
||||
public: 0x044a5262,
|
||||
private: 0x044a4e28
|
||||
},
|
||||
pubKeyHash: 0x6f,
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xef
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.deeponion.p2wpkh = {
|
||||
baseNetwork: "deeponion",
|
||||
messagePrefix: '\x18DeepOnion Signed Message:\n',
|
||||
bech32: 'dpn',
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488ade4
|
||||
},
|
||||
pubKeyHash: 0x1f,
|
||||
scriptHash: 0x4e,
|
||||
wif: 0x9f
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.deeponion.p2wpkhInP2sh = {
|
||||
baseNetwork: "deeponion",
|
||||
messagePrefix: '\x18DeepOnion Signed Message:\n',
|
||||
bech32: 'dpn',
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488ade4
|
||||
},
|
||||
pubKeyHash: 0x1f,
|
||||
scriptHash: 0x4e,
|
||||
wif: 0x9f
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.sugarchain.p2wpkh = {
|
||||
baseNetwork: "sugarchain",
|
||||
messagePrefix: '\x1DSugarchain Signed Message:\n',
|
||||
bech32: 'sugar',
|
||||
bip32: {
|
||||
public: 0x04b24746,
|
||||
private: 0x04b2430c
|
||||
},
|
||||
pubKeyHash: 0x3f,
|
||||
scriptHash: 0x7d,
|
||||
wif: 0x80
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.sugarchain.p2wpkhInP2sh = {
|
||||
baseNetwork: "sugarchain",
|
||||
messagePrefix: '\x1DSugarchain Signed Message:\n',
|
||||
bech32: 'sugar',
|
||||
bip32: {
|
||||
public: 0x049d7cb2,
|
||||
private: 0x049d7878
|
||||
},
|
||||
pubKeyHash: 0x3f,
|
||||
scriptHash: 0x7d,
|
||||
wif: 0x80
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.sugarchaintestnet.p2wpkh = {
|
||||
baseNetwork: "sugarchaintestnet",
|
||||
messagePrefix: '\x18Sugarchain Signed Message:\n',
|
||||
bech32: 'tugar',
|
||||
bip32: {
|
||||
public: 0x045f1cf6,
|
||||
private: 0x045f18bc
|
||||
},
|
||||
pubKeyHash: 0x42,
|
||||
scriptHash: 0x80,
|
||||
wif: 0xef
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.sugarchaintestnet.p2wpkhInP2sh = {
|
||||
baseNetwork: "sugarchaintestnet",
|
||||
messagePrefix: '\x18Sugarchain Signed Message:\n',
|
||||
bech32: 'tugar',
|
||||
bip32: {
|
||||
public: 0x044a5262,
|
||||
private: 0x044a4e28
|
||||
},
|
||||
pubKeyHash: 0x42,
|
||||
scriptHash: 0x80,
|
||||
wif: 0xef
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -26,13 +26,13 @@ var sjcl = {
|
||||
|
||||
/** @namespace Key exchange functions. Right now only SRP is implemented. */
|
||||
keyexchange: {},
|
||||
|
||||
|
||||
/** @namespace Block cipher modes of operation. */
|
||||
mode: {},
|
||||
|
||||
/** @namespace Miscellaneous. HMAC and PBKDF2. */
|
||||
misc: {},
|
||||
|
||||
|
||||
/**
|
||||
* @namespace Bit array encoders and decoders.
|
||||
*
|
||||
@@ -43,7 +43,7 @@ var sjcl = {
|
||||
* the method names are "fromBits" and "toBits".
|
||||
*/
|
||||
codec: {},
|
||||
|
||||
|
||||
/** @namespace Exceptions. */
|
||||
exception: {
|
||||
/** @constructor Ciphertext is corrupt. */
|
||||
@@ -51,13 +51,13 @@ var sjcl = {
|
||||
this.toString = function() { return "CORRUPT: "+this.message; };
|
||||
this.message = message;
|
||||
},
|
||||
|
||||
|
||||
/** @constructor Invalid parameter. */
|
||||
invalid: function(message) {
|
||||
this.toString = function() { return "INVALID: "+this.message; };
|
||||
this.message = message;
|
||||
},
|
||||
|
||||
|
||||
/** @constructor Bug or missing feature in SJCL. @constructor */
|
||||
bug: function(message) {
|
||||
this.toString = function() { return "BUG: "+this.message; };
|
||||
@@ -159,7 +159,7 @@ sjcl.bitArray = {
|
||||
if (a1.length === 0 || a2.length === 0) {
|
||||
return a1.concat(a2);
|
||||
}
|
||||
|
||||
|
||||
var last = a1[a1.length-1], shift = sjcl.bitArray.getPartial(last);
|
||||
if (shift === 32) {
|
||||
return a1.concat(a2);
|
||||
@@ -245,7 +245,7 @@ sjcl.bitArray = {
|
||||
_shiftRight: function (a, shift, carry, out) {
|
||||
var i, last2=0, shift2;
|
||||
if (out === undefined) { out = []; }
|
||||
|
||||
|
||||
for (; shift >= 32; shift -= 32) {
|
||||
out.push(carry);
|
||||
carry = 0;
|
||||
@@ -253,7 +253,7 @@ sjcl.bitArray = {
|
||||
if (shift === 0) {
|
||||
return out.concat(a);
|
||||
}
|
||||
|
||||
|
||||
for (i=0; i<a.length; i++) {
|
||||
out.push(carry | a[i]>>>shift);
|
||||
carry = a[i] << (32-shift);
|
||||
@@ -263,7 +263,7 @@ sjcl.bitArray = {
|
||||
out.push(sjcl.bitArray.partial(shift+shift2 & 31, (shift + shift2 > 32) ? carry : out.pop(),1));
|
||||
return out;
|
||||
},
|
||||
|
||||
|
||||
/** xor a block of 4 words together.
|
||||
* @private
|
||||
*/
|
||||
@@ -295,7 +295,7 @@ sjcl.bitArray = {
|
||||
* @author Mike Hamburg
|
||||
* @author Dan Boneh
|
||||
*/
|
||||
|
||||
|
||||
/** @namespace UTF-8 strings */
|
||||
sjcl.codec.utf8String = {
|
||||
/** Convert from a bitArray to a UTF-8 string. */
|
||||
@@ -310,7 +310,7 @@ sjcl.codec.utf8String = {
|
||||
}
|
||||
return decodeURIComponent(escape(out));
|
||||
},
|
||||
|
||||
|
||||
/** Convert from a UTF-8 string to a bitArray. */
|
||||
toBits: function (str) {
|
||||
str = unescape(encodeURIComponent(str));
|
||||
@@ -412,7 +412,7 @@ sjcl.hash.sha512.prototype = {
|
||||
* @constant
|
||||
*/
|
||||
blockSize: 1024,
|
||||
|
||||
|
||||
/**
|
||||
* Reset the hash state.
|
||||
* @return this
|
||||
@@ -423,7 +423,7 @@ sjcl.hash.sha512.prototype = {
|
||||
this._length = 0;
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Input several words to the hash.
|
||||
* @param {bitArray|String} data the data to hash.
|
||||
@@ -441,7 +441,7 @@ sjcl.hash.sha512.prototype = {
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Complete hashing and output the hash value.
|
||||
* @return {bitArray} The hash value, an array of 16 big-endian words.
|
||||
@@ -736,12 +736,12 @@ sjcl.misc.hmac = function (key, Hash) {
|
||||
if (key.length > bs) {
|
||||
key = Hash.hash(key);
|
||||
}
|
||||
|
||||
|
||||
for (i=0; i<bs; i++) {
|
||||
exKey[0][i] = key[i]^0x36363636;
|
||||
exKey[1][i] = key[i]^0x5C5C5C5C;
|
||||
}
|
||||
|
||||
|
||||
this._baseHash[0].update(exKey[0]);
|
||||
this._baseHash[1].update(exKey[1]);
|
||||
this._resultHash = new Hash(this._baseHash[0]);
|
||||
@@ -804,34 +804,34 @@ sjcl.misc.hmac.prototype.digest = function () {
|
||||
*/
|
||||
sjcl.misc.pbkdf2 = function (password, salt, count, length, Prff) {
|
||||
count = count || 1000;
|
||||
|
||||
|
||||
if (length < 0 || count < 0) {
|
||||
throw sjcl.exception.invalid("invalid params to pbkdf2");
|
||||
}
|
||||
|
||||
|
||||
if (typeof password === "string") {
|
||||
password = sjcl.codec.utf8String.toBits(password);
|
||||
}
|
||||
|
||||
|
||||
if (typeof salt === "string") {
|
||||
salt = sjcl.codec.utf8String.toBits(salt);
|
||||
}
|
||||
|
||||
|
||||
Prff = Prff || sjcl.misc.hmac;
|
||||
|
||||
|
||||
var prf = new Prff(password),
|
||||
u, ui, i, j, k, out = [], b = sjcl.bitArray;
|
||||
|
||||
for (k = 1; 32 * out.length < (length || 1); k++) {
|
||||
u = ui = prf.encrypt(b.concat(salt,[k]));
|
||||
|
||||
|
||||
for (i=1; i<count; i++) {
|
||||
ui = prf.encrypt(ui);
|
||||
for (j=0; j<ui.length; j++) {
|
||||
u[j] ^= ui[j];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
out = out.concat(u);
|
||||
}
|
||||
|
||||
@@ -890,7 +890,7 @@ sjcl.hash.sha256.prototype = {
|
||||
* @constant
|
||||
*/
|
||||
blockSize: 512,
|
||||
|
||||
|
||||
/**
|
||||
* Reset the hash state.
|
||||
* @return this
|
||||
@@ -901,7 +901,7 @@ sjcl.hash.sha256.prototype = {
|
||||
this._length = 0;
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Input several words to the hash.
|
||||
* @param {bitArray|String} data the data to hash.
|
||||
@@ -919,7 +919,7 @@ sjcl.hash.sha256.prototype = {
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Complete hashing and output the hash value.
|
||||
* @return {bitArray} The hash value, an array of 8 big-endian words.
|
||||
@@ -929,12 +929,12 @@ sjcl.hash.sha256.prototype = {
|
||||
|
||||
// Round out and push the buffer
|
||||
b = sjcl.bitArray.concat(b, [sjcl.bitArray.partial(1,1)]);
|
||||
|
||||
|
||||
// Round out the buffer to a multiple of 16 words, less the 2 length words.
|
||||
for (i = b.length + 2; i & 15; i++) {
|
||||
b.push(0);
|
||||
}
|
||||
|
||||
|
||||
// append the length
|
||||
b.push(Math.floor(this._length / 0x100000000));
|
||||
b.push(this._length | 0);
|
||||
@@ -955,7 +955,7 @@ sjcl.hash.sha256.prototype = {
|
||||
/*
|
||||
_init:[0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19],
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* The SHA-256 hash key, to be precomputed.
|
||||
* @private
|
||||
@@ -990,7 +990,7 @@ sjcl.hash.sha256.prototype = {
|
||||
continue outer;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (i<8) {
|
||||
this._init[i] = frac(Math.pow(prime, 1/2));
|
||||
}
|
||||
@@ -998,13 +998,13 @@ sjcl.hash.sha256.prototype = {
|
||||
i++;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Perform one cycle of SHA-256.
|
||||
* @param {bitArray} words one block of words.
|
||||
* @private
|
||||
*/
|
||||
_block:function (words) {
|
||||
_block:function (words) {
|
||||
var i, tmp, a, b,
|
||||
w = words.slice(0),
|
||||
h = this._h,
|
||||
@@ -1032,13 +1032,13 @@ sjcl.hash.sha256.prototype = {
|
||||
} else {
|
||||
a = w[(i+1 ) & 15];
|
||||
b = w[(i+14) & 15];
|
||||
tmp = w[i&15] = ((a>>>7 ^ a>>>18 ^ a>>>3 ^ a<<25 ^ a<<14) +
|
||||
tmp = w[i&15] = ((a>>>7 ^ a>>>18 ^ a>>>3 ^ a<<25 ^ a<<14) +
|
||||
(b>>>17 ^ b>>>19 ^ b>>>10 ^ b<<15 ^ b<<13) +
|
||||
w[i&15] + w[(i+9) & 15]) | 0;
|
||||
}
|
||||
|
||||
|
||||
tmp = (tmp + h7 + (h4>>>6 ^ h4>>>11 ^ h4>>>25 ^ h4<<26 ^ h4<<21 ^ h4<<7) + (h6 ^ h4&(h5^h6)) + k[i]); // | 0;
|
||||
|
||||
|
||||
// shift register
|
||||
h7 = h6; h6 = h5; h5 = h4;
|
||||
h4 = h3 + tmp | 0;
|
||||
|
||||
445
src/js/unorm.js
445
src/js/unorm.js
File diff suppressed because one or more lines are too long
14
src/js/wordlist_czech.js
Normal file
14
src/js/wordlist_czech.js
Normal file
File diff suppressed because one or more lines are too long
197
src/js/wordlist_portuguese.js
Normal file
197
src/js/wordlist_portuguese.js
Normal file
@@ -0,0 +1,197 @@
|
||||
WORDLISTS = typeof
|
||||
WORDLISTS == "undefined" ? {}: WORDLISTS;
|
||||
WORDLISTS["portuguese"] = [
|
||||
"abacate", "abaixo", "abalar", "abater", "abduzir", "abelha", "aberto", "abismo", "abotoar", "abranger", "abreviar",
|
||||
"abrigar", "abrupto", "absinto", "absoluto", "absurdo", "abutre", "acabado", "acalmar", "acampar", "acanhar",
|
||||
"acaso", "aceitar", "acelerar", "acenar", "acervo", "acessar", "acetona", "achatar", "acidez", "acima", "acionado",
|
||||
"acirrar", "aclamar", "aclive", "acolhida", "acomodar", "acoplar", "acordar", "acumular", "acusador", "adaptar",
|
||||
"adega", "adentro", "adepto", "adequar", "aderente", "adesivo", "adeus", "adiante", "aditivo", "adjetivo",
|
||||
"adjunto", "admirar", "adorar", "adquirir", "adubo", "adverso", "advogado", "aeronave", "afastar", "aferir",
|
||||
"afetivo", "afinador", "afivelar", "aflito", "afluente", "afrontar", "agachar", "agarrar", "agasalho", "agenciar",
|
||||
"agilizar", "agiota", "agitado", "agora", "agradar", "agreste", "agrupar", "aguardar", "agulha", "ajoelhar",
|
||||
"ajudar", "ajustar", "alameda", "alarme", "alastrar", "alavanca", "albergue", "albino", "alcatra", "aldeia",
|
||||
"alecrim", "alegria", "alertar", "alface", "alfinete", "algum", "alheio", "aliar", "alicate", "alienar", "alinhar",
|
||||
"aliviar", "almofada", "alocar", "alpiste", "alterar", "altitude", "alucinar", "alugar", "aluno", "alusivo", "alvo",
|
||||
"amaciar", "amador", "amarelo", "amassar", "ambas", "ambiente", "ameixa", "amenizar", "amido", "amistoso",
|
||||
"amizade", "amolador", "amontoar", "amoroso", "amostra", "amparar", "ampliar", "ampola", "anagrama", "analisar",
|
||||
"anarquia", "anatomia", "andaime", "anel", "anexo", "angular", "animar", "anjo", "anomalia", "anotado", "ansioso",
|
||||
"anterior", "anuidade", "anunciar", "anzol", "apagador", "apalpar", "apanhado", "apego", "apelido", "apertada",
|
||||
"apesar", "apetite", "apito", "aplauso", "aplicada", "apoio", "apontar", "aposta", "aprendiz", "aprovar", "aquecer",
|
||||
"arame", "aranha", "arara", "arcada", "ardente", "areia", "arejar", "arenito", "aresta", "argiloso", "argola",
|
||||
"arma", "arquivo", "arraial", "arrebate", "arriscar", "arroba", "arrumar", "arsenal", "arterial", "artigo",
|
||||
"arvoredo", "asfaltar", "asilado", "aspirar", "assador", "assinar", "assoalho", "assunto", "astral", "atacado",
|
||||
"atadura", "atalho", "atarefar", "atear", "atender", "aterro", "ateu", "atingir", "atirador", "ativo", "atoleiro",
|
||||
"atracar", "atrevido", "atriz", "atual", "atum", "auditor", "aumentar", "aura", "aurora", "autismo", "autoria",
|
||||
"autuar", "avaliar", "avante", "avaria", "avental", "avesso", "aviador", "avisar", "avulso", "axila", "azarar",
|
||||
"azedo", "azeite", "azulejo", "babar", "babosa", "bacalhau", "bacharel", "bacia", "bagagem", "baiano", "bailar",
|
||||
"baioneta", "bairro", "baixista", "bajular", "baleia", "baliza", "balsa", "banal", "bandeira", "banho", "banir",
|
||||
"banquete", "barato", "barbado", "baronesa", "barraca", "barulho", "baseado", "bastante", "batata", "batedor",
|
||||
"batida", "batom", "batucar", "baunilha", "beber", "beijo", "beirada", "beisebol", "beldade", "beleza", "belga",
|
||||
"beliscar", "bendito", "bengala", "benzer", "berimbau", "berlinda", "berro", "besouro", "bexiga", "bezerro", "bico",
|
||||
"bicudo", "bienal", "bifocal", "bifurcar", "bigorna", "bilhete", "bimestre", "bimotor", "biologia", "biombo",
|
||||
"biosfera", "bipolar", "birrento", "biscoito", "bisneto", "bispo", "bissexto", "bitola", "bizarro", "blindado",
|
||||
"bloco", "bloquear", "boato", "bobagem", "bocado", "bocejo", "bochecha", "boicotar", "bolada", "boletim", "bolha",
|
||||
"bolo", "bombeiro", "bonde", "boneco", "bonita", "borbulha", "borda", "boreal", "borracha", "bovino", "boxeador",
|
||||
"branco", "brasa", "braveza", "breu", "briga", "brilho", "brincar", "broa", "brochura", "bronzear", "broto",
|
||||
"bruxo", "bucha", "budismo", "bufar", "bule", "buraco", "busca", "busto", "buzina", "cabana", "cabelo", "cabide",
|
||||
"cabo", "cabrito", "cacau", "cacetada", "cachorro", "cacique", "cadastro", "cadeado", "cafezal", "caiaque",
|
||||
"caipira", "caixote", "cajado", "caju", "calafrio", "calcular", "caldeira", "calibrar", "calmante", "calota",
|
||||
"camada", "cambista", "camisa", "camomila", "campanha", "camuflar", "canavial", "cancelar", "caneta", "canguru",
|
||||
"canhoto", "canivete", "canoa", "cansado", "cantar", "canudo", "capacho", "capela", "capinar", "capotar",
|
||||
"capricho", "captador", "capuz", "caracol", "carbono", "cardeal", "careca", "carimbar", "carneiro", "carpete",
|
||||
"carreira", "cartaz", "carvalho", "casaco", "casca", "casebre", "castelo", "casulo", "catarata", "cativar", "caule",
|
||||
"causador", "cautelar", "cavalo", "caverna", "cebola", "cedilha", "cegonha", "celebrar", "celular", "cenoura",
|
||||
"censo", "centeio", "cercar", "cerrado", "certeiro", "cerveja", "cetim", "cevada", "chacota", "chaleira", "chamado",
|
||||
"chapada", "charme", "chatice", "chave", "chefe", "chegada", "cheiro", "cheque", "chicote", "chifre", "chinelo",
|
||||
"chocalho", "chover", "chumbo", "chutar", "chuva", "cicatriz", "ciclone", "cidade", "cidreira", "ciente", "cigana",
|
||||
"cimento", "cinto", "cinza", "ciranda", "circuito", "cirurgia", "citar", "clareza", "clero", "clicar", "clone",
|
||||
"clube", "coado", "coagir", "cobaia", "cobertor", "cobrar", "cocada", "coelho", "coentro", "coeso", "cogumelo",
|
||||
"coibir", "coifa", "coiote", "colar", "coleira", "colher", "colidir", "colmeia", "colono", "coluna", "comando",
|
||||
"combinar", "comentar", "comitiva", "comover", "complexo", "comum", "concha", "condor", "conectar", "confuso",
|
||||
"congelar", "conhecer", "conjugar", "consumir", "contrato", "convite", "cooperar", "copeiro", "copiador", "copo",
|
||||
"coquetel", "coragem", "cordial", "corneta", "coronha", "corporal", "correio", "cortejo", "coruja", "corvo",
|
||||
"cosseno", "costela", "cotonete", "couro", "couve", "covil", "cozinha", "cratera", "cravo", "creche", "credor",
|
||||
"creme", "crer", "crespo", "criada", "criminal", "crioulo", "crise", "criticar", "crosta", "crua", "cruzeiro",
|
||||
"cubano", "cueca", "cuidado", "cujo", "culatra", "culminar", "culpar", "cultura", "cumprir", "cunhado", "cupido",
|
||||
"curativo", "curral", "cursar", "curto", "cuspir", "custear", "cutelo", "damasco", "datar", "debater", "debitar",
|
||||
"deboche", "debulhar", "decalque", "decimal", "declive", "decote", "decretar", "dedal", "dedicado", "deduzir",
|
||||
"defesa", "defumar", "degelo", "degrau", "degustar", "deitado", "deixar", "delator", "delegado", "delinear",
|
||||
"delonga", "demanda", "demitir", "demolido", "dentista", "depenado", "depilar", "depois", "depressa", "depurar",
|
||||
"deriva", "derramar", "desafio", "desbotar", "descanso", "desenho", "desfiado", "desgaste", "desigual", "deslize",
|
||||
"desmamar", "desova", "despesa", "destaque", "desviar", "detalhar", "detentor", "detonar", "detrito", "deusa",
|
||||
"dever", "devido", "devotado", "dezena", "diagrama", "dialeto", "didata", "difuso", "digitar", "dilatado",
|
||||
"diluente", "diminuir", "dinastia", "dinheiro", "diocese", "direto", "discreta", "disfarce", "disparo", "disquete",
|
||||
"dissipar", "distante", "ditador", "diurno", "diverso", "divisor", "divulgar", "dizer", "dobrador", "dolorido",
|
||||
"domador", "dominado", "donativo", "donzela", "dormente", "dorsal", "dosagem", "dourado", "doutor", "drenagem",
|
||||
"drible", "drogaria", "duelar", "duende", "dueto", "duplo", "duquesa", "durante", "duvidoso", "eclodir", "ecoar",
|
||||
"ecologia", "edificar", "edital", "educado", "efeito", "efetivar", "ejetar", "elaborar", "eleger", "eleitor",
|
||||
"elenco", "elevador", "eliminar", "elogiar", "embargo", "embolado", "embrulho", "embutido", "emenda", "emergir",
|
||||
"emissor", "empatia", "empenho", "empinado", "empolgar", "emprego", "empurrar", "emulador", "encaixe", "encenado",
|
||||
"enchente", "encontro", "endeusar", "endossar", "enfaixar", "enfeite", "enfim", "engajado", "engenho", "englobar",
|
||||
"engomado", "engraxar", "enguia", "enjoar", "enlatar", "enquanto", "enraizar", "enrolado", "enrugar", "ensaio",
|
||||
"enseada", "ensino", "ensopado", "entanto", "enteado", "entidade", "entortar", "entrada", "entulho", "envergar",
|
||||
"enviado", "envolver", "enxame", "enxerto", "enxofre", "enxuto", "epiderme", "equipar", "ereto", "erguido",
|
||||
"errata", "erva", "ervilha", "esbanjar", "esbelto", "escama", "escola", "escrita", "escuta", "esfinge", "esfolar",
|
||||
"esfregar", "esfumado", "esgrima", "esmalte", "espanto", "espelho", "espiga", "esponja", "espreita", "espumar",
|
||||
"esquerda", "estaca", "esteira", "esticar", "estofado", "estrela", "estudo", "esvaziar", "etanol", "etiqueta",
|
||||
"euforia", "europeu", "evacuar", "evaporar", "evasivo", "eventual", "evidente", "evoluir", "exagero", "exalar",
|
||||
"examinar", "exato", "exausto", "excesso", "excitar", "exclamar", "executar", "exemplo", "exibir", "exigente",
|
||||
"exonerar", "expandir", "expelir", "expirar", "explanar", "exposto", "expresso", "expulsar", "externo", "extinto",
|
||||
"extrato", "fabricar", "fabuloso", "faceta", "facial", "fada", "fadiga", "faixa", "falar", "falta", "familiar",
|
||||
"fandango", "fanfarra", "fantoche", "fardado", "farelo", "farinha", "farofa", "farpa", "fartura", "fatia", "fator",
|
||||
"favorita", "faxina", "fazenda", "fechado", "feijoada", "feirante", "felino", "feminino", "fenda", "feno", "fera",
|
||||
"feriado", "ferrugem", "ferver", "festejar", "fetal", "feudal", "fiapo", "fibrose", "ficar", "ficheiro", "figurado",
|
||||
"fileira", "filho", "filme", "filtrar", "firmeza", "fisgada", "fissura", "fita", "fivela", "fixador", "fixo",
|
||||
"flacidez", "flamingo", "flanela", "flechada", "flora", "flutuar", "fluxo", "focal", "focinho", "fofocar", "fogo",
|
||||
"foguete", "foice", "folgado", "folheto", "forjar", "formiga", "forno", "forte", "fosco", "fossa", "fragata",
|
||||
"fralda", "frango", "frasco", "fraterno", "freira", "frente", "fretar", "frieza", "friso", "fritura", "fronha",
|
||||
"frustrar", "fruteira", "fugir", "fulano", "fuligem", "fundar", "fungo", "funil", "furador", "furioso", "futebol",
|
||||
"gabarito", "gabinete", "gado", "gaiato", "gaiola", "gaivota", "galega", "galho", "galinha", "galocha", "ganhar",
|
||||
"garagem", "garfo", "gargalo", "garimpo", "garoupa", "garrafa", "gasoduto", "gasto", "gata", "gatilho", "gaveta",
|
||||
"gazela", "gelado", "geleia", "gelo", "gemada", "gemer", "gemido", "generoso", "gengiva", "genial", "genoma",
|
||||
"genro", "geologia", "gerador", "germinar", "gesso", "gestor", "ginasta", "gincana", "gingado", "girafa", "girino",
|
||||
"glacial", "glicose", "global", "glorioso", "goela", "goiaba", "golfe", "golpear", "gordura", "gorjeta", "gorro",
|
||||
"gostoso", "goteira", "governar", "gracejo", "gradual", "grafite", "gralha", "grampo", "granada", "gratuito",
|
||||
"graveto", "graxa", "grego", "grelhar", "greve", "grilo", "grisalho", "gritaria", "grosso", "grotesco", "grudado",
|
||||
"grunhido", "gruta", "guache", "guarani", "guaxinim", "guerrear", "guiar", "guincho", "guisado", "gula", "guloso",
|
||||
"guru", "habitar", "harmonia", "haste", "haver", "hectare", "herdar", "heresia", "hesitar", "hiato", "hibernar",
|
||||
"hidratar", "hiena", "hino", "hipismo", "hipnose", "hipoteca", "hoje", "holofote", "homem", "honesto", "honrado",
|
||||
"hormonal", "hospedar", "humorado", "iate", "ideia", "idoso", "ignorado", "igreja", "iguana", "ileso", "ilha",
|
||||
"iludido", "iluminar", "ilustrar", "imagem", "imediato", "imenso", "imersivo", "iminente", "imitador", "imortal",
|
||||
"impacto", "impedir", "implante", "impor", "imprensa", "impune", "imunizar", "inalador", "inapto", "inativo",
|
||||
"incenso", "inchar", "incidir", "incluir", "incolor", "indeciso", "indireto", "indutor", "ineficaz", "inerente",
|
||||
"infantil", "infestar", "infinito", "inflamar", "informal", "infrator", "ingerir", "inibido", "inicial", "inimigo",
|
||||
"injetar", "inocente", "inodoro", "inovador", "inox", "inquieto", "inscrito", "inseto", "insistir", "inspetor",
|
||||
"instalar", "insulto", "intacto", "integral", "intimar", "intocado", "intriga", "invasor", "inverno", "invicto",
|
||||
"invocar", "iogurte", "iraniano", "ironizar", "irreal", "irritado", "isca", "isento", "isolado", "isqueiro",
|
||||
"italiano", "janeiro", "jangada", "janta", "jararaca", "jardim", "jarro", "jasmim", "jato", "javali", "jazida",
|
||||
"jejum", "joaninha", "joelhada", "jogador", "joia", "jornal", "jorrar", "jovem", "juba", "judeu", "judoca", "juiz",
|
||||
"julgador", "julho", "jurado", "jurista", "juro", "justa", "labareda", "laboral", "lacre", "lactante", "ladrilho",
|
||||
"lagarta", "lagoa", "laje", "lamber", "lamentar", "laminar", "lampejo", "lanche", "lapidar", "lapso", "laranja",
|
||||
"lareira", "largura", "lasanha", "lastro", "lateral", "latido", "lavanda", "lavoura", "lavrador", "laxante",
|
||||
"lazer", "lealdade", "lebre", "legado", "legendar", "legista", "leigo", "leiloar", "leitura", "lembrete", "leme",
|
||||
"lenhador", "lentilha", "leoa", "lesma", "leste", "letivo", "letreiro", "levar", "leveza", "levitar", "liberal",
|
||||
"libido", "liderar", "ligar", "ligeiro", "limitar", "limoeiro", "limpador", "linda", "linear", "linhagem",
|
||||
"liquidez", "listagem", "lisura", "litoral", "livro", "lixa", "lixeira", "locador", "locutor", "lojista", "lombo",
|
||||
"lona", "longe", "lontra", "lorde", "lotado", "loteria", "loucura", "lousa", "louvar", "luar", "lucidez", "lucro",
|
||||
"luneta", "lustre", "lutador", "luva", "macaco", "macete", "machado", "macio", "madeira", "madrinha", "magnata",
|
||||
"magreza", "maior", "mais", "malandro", "malha", "malote", "maluco", "mamilo", "mamoeiro", "mamute", "manada",
|
||||
"mancha", "mandato", "manequim", "manhoso", "manivela", "manobrar", "mansa", "manter", "manusear", "mapeado",
|
||||
"maquinar", "marcador", "maresia", "marfim", "margem", "marinho", "marmita", "maroto", "marquise", "marreco",
|
||||
"martelo", "marujo", "mascote", "masmorra", "massagem", "mastigar", "matagal", "materno", "matinal", "matutar",
|
||||
"maxilar", "medalha", "medida", "medusa", "megafone", "meiga", "melancia", "melhor", "membro", "memorial", "menino",
|
||||
"menos", "mensagem", "mental", "merecer", "mergulho", "mesada", "mesclar", "mesmo", "mesquita", "mestre", "metade",
|
||||
"meteoro", "metragem", "mexer", "mexicano", "micro", "migalha", "migrar", "milagre", "milenar", "milhar", "mimado",
|
||||
"minerar", "minhoca", "ministro", "minoria", "miolo", "mirante", "mirtilo", "misturar", "mocidade", "moderno",
|
||||
"modular", "moeda", "moer", "moinho", "moita", "moldura", "moleza", "molho", "molinete", "molusco", "montanha",
|
||||
"moqueca", "morango", "morcego", "mordomo", "morena", "mosaico", "mosquete", "mostarda", "motel", "motim", "moto",
|
||||
"motriz", "muda", "muito", "mulata", "mulher", "multar", "mundial", "munido", "muralha", "murcho", "muscular",
|
||||
"museu", "musical", "nacional", "nadador", "naja", "namoro", "narina", "narrado", "nascer", "nativa", "natureza",
|
||||
"navalha", "navegar", "navio", "neblina", "nebuloso", "negativa", "negociar", "negrito", "nervoso", "neta",
|
||||
"neural", "nevasca", "nevoeiro", "ninar", "ninho", "nitidez", "nivelar", "nobreza", "noite", "noiva", "nomear",
|
||||
"nominal", "nordeste", "nortear", "notar", "noticiar", "noturno", "novelo", "novilho", "novo", "nublado", "nudez",
|
||||
"numeral", "nupcial", "nutrir", "nuvem", "obcecado", "obedecer", "objetivo", "obrigado", "obscuro", "obstetra",
|
||||
"obter", "obturar", "ocidente", "ocioso", "ocorrer", "oculista", "ocupado", "ofegante", "ofensiva", "oferenda",
|
||||
"oficina", "ofuscado", "ogiva", "olaria", "oleoso", "olhar", "oliveira", "ombro", "omelete", "omisso", "omitir",
|
||||
"ondulado", "oneroso", "ontem", "opcional", "operador", "oponente", "oportuno", "oposto", "orar", "orbitar",
|
||||
"ordem", "ordinal", "orfanato", "orgasmo", "orgulho", "oriental", "origem", "oriundo", "orla", "ortodoxo",
|
||||
"orvalho", "oscilar", "ossada", "osso", "ostentar", "otimismo", "ousadia", "outono", "outubro", "ouvido", "ovelha",
|
||||
"ovular", "oxidar", "oxigenar", "pacato", "paciente", "pacote", "pactuar", "padaria", "padrinho", "pagar", "pagode",
|
||||
"painel", "pairar", "paisagem", "palavra", "palestra", "palheta", "palito", "palmada", "palpitar", "pancada",
|
||||
"panela", "panfleto", "panqueca", "pantanal", "papagaio", "papelada", "papiro", "parafina", "parcial", "pardal",
|
||||
"parede", "partida", "pasmo", "passado", "pastel", "patamar", "patente", "patinar", "patrono", "paulada", "pausar",
|
||||
"peculiar", "pedalar", "pedestre", "pediatra", "pedra", "pegada", "peitoral", "peixe", "pele", "pelicano", "penca",
|
||||
"pendurar", "peneira", "penhasco", "pensador", "pente", "perceber", "perfeito", "pergunta", "perito", "permitir",
|
||||
"perna", "perplexo", "persiana", "pertence", "peruca", "pescado", "pesquisa", "pessoa", "petiscar", "piada",
|
||||
"picado", "piedade", "pigmento", "pilastra", "pilhado", "pilotar", "pimenta", "pincel", "pinguim", "pinha",
|
||||
"pinote", "pintar", "pioneiro", "pipoca", "piquete", "piranha", "pires", "pirueta", "piscar", "pistola", "pitanga",
|
||||
"pivete", "planta", "plaqueta", "platina", "plebeu", "plumagem", "pluvial", "pneu", "poda", "poeira", "poetisa",
|
||||
"polegada", "policiar", "poluente", "polvilho", "pomar", "pomba", "ponderar", "pontaria", "populoso", "porta",
|
||||
"possuir", "postal", "pote", "poupar", "pouso", "povoar", "praia", "prancha", "prato", "praxe", "prece", "predador",
|
||||
"prefeito", "premiar", "prensar", "preparar", "presilha", "pretexto", "prevenir", "prezar", "primata", "princesa",
|
||||
"prisma", "privado", "processo", "produto", "profeta", "proibido", "projeto", "prometer", "propagar", "prosa",
|
||||
"protetor", "provador", "publicar", "pudim", "pular", "pulmonar", "pulseira", "punhal", "punir", "pupilo", "pureza",
|
||||
"puxador", "quadra", "quantia", "quarto", "quase", "quebrar", "queda", "queijo", "quente", "querido", "quimono",
|
||||
"quina", "quiosque", "rabanada", "rabisco", "rachar", "racionar", "radial", "raiar", "rainha", "raio", "raiva",
|
||||
"rajada", "ralado", "ramal", "ranger", "ranhura", "rapadura", "rapel", "rapidez", "raposa", "raquete", "raridade",
|
||||
"rasante", "rascunho", "rasgar", "raspador", "rasteira", "rasurar", "ratazana", "ratoeira", "realeza", "reanimar",
|
||||
"reaver", "rebaixar", "rebelde", "rebolar", "recado", "recente", "recheio", "recibo", "recordar", "recrutar",
|
||||
"recuar", "rede", "redimir", "redonda", "reduzida", "reenvio", "refinar", "refletir", "refogar", "refresco",
|
||||
"refugiar", "regalia", "regime", "regra", "reinado", "reitor", "rejeitar", "relativo", "remador", "remendo",
|
||||
"remorso", "renovado", "reparo", "repelir", "repleto", "repolho", "represa", "repudiar", "requerer", "resenha",
|
||||
"resfriar", "resgatar", "residir", "resolver", "respeito", "ressaca", "restante", "resumir", "retalho", "reter",
|
||||
"retirar", "retomada", "retratar", "revelar", "revisor", "revolta", "riacho", "rica", "rigidez", "rigoroso",
|
||||
"rimar", "ringue", "risada", "risco", "risonho", "robalo", "rochedo", "rodada", "rodeio", "rodovia", "roedor",
|
||||
"roleta", "romano", "roncar", "rosado", "roseira", "rosto", "rota", "roteiro", "rotina", "rotular", "rouco",
|
||||
"roupa", "roxo", "rubro", "rugido", "rugoso", "ruivo", "rumo", "rupestre", "russo", "sabor", "saciar", "sacola",
|
||||
"sacudir", "sadio", "safira", "saga", "sagrada", "saibro", "salada", "saleiro", "salgado", "saliva", "salpicar",
|
||||
"salsicha", "saltar", "salvador", "sambar", "samurai", "sanar", "sanfona", "sangue", "sanidade", "sapato", "sarda",
|
||||
"sargento", "sarjeta", "saturar", "saudade", "saxofone", "sazonal", "secar", "secular", "seda", "sedento",
|
||||
"sediado", "sedoso", "sedutor", "segmento", "segredo", "segundo", "seiva", "seleto", "selvagem", "semanal",
|
||||
"semente", "senador", "senhor", "sensual", "sentado", "separado", "sereia", "seringa", "serra", "servo", "setembro",
|
||||
"setor", "sigilo", "silhueta", "silicone", "simetria", "simpatia", "simular", "sinal", "sincero", "singular",
|
||||
"sinopse", "sintonia", "sirene", "siri", "situado", "soberano", "sobra", "socorro", "sogro", "soja", "solda",
|
||||
"soletrar", "solteiro", "sombrio", "sonata", "sondar", "sonegar", "sonhador", "sono", "soprano", "soquete",
|
||||
"sorrir", "sorteio", "sossego", "sotaque", "soterrar", "sovado", "sozinho", "suavizar", "subida", "submerso",
|
||||
"subsolo", "subtrair", "sucata", "sucesso", "suco", "sudeste", "sufixo", "sugador", "sugerir", "sujeito", "sulfato",
|
||||
"sumir", "suor", "superior", "suplicar", "suposto", "suprimir", "surdina", "surfista", "surpresa", "surreal",
|
||||
"surtir", "suspiro", "sustento", "tabela", "tablete", "tabuada", "tacho", "tagarela", "talher", "talo", "talvez",
|
||||
"tamanho", "tamborim", "tampa", "tangente", "tanto", "tapar", "tapioca", "tardio", "tarefa", "tarja", "tarraxa",
|
||||
"tatuagem", "taurino", "taxativo", "taxista", "teatral", "tecer", "tecido", "teclado", "tedioso", "teia", "teimar",
|
||||
"telefone", "telhado", "tempero", "tenente", "tensor", "tentar", "termal", "terno", "terreno", "tese", "tesoura",
|
||||
"testado", "teto", "textura", "texugo", "tiara", "tigela", "tijolo", "timbrar", "timidez", "tingido", "tinteiro",
|
||||
"tiragem", "titular", "toalha", "tocha", "tolerar", "tolice", "tomada", "tomilho", "tonel", "tontura", "topete",
|
||||
"tora", "torcido", "torneio", "torque", "torrada", "torto", "tostar", "touca", "toupeira", "toxina", "trabalho",
|
||||
"tracejar", "tradutor", "trafegar", "trajeto", "trama", "trancar", "trapo", "traseiro", "tratador", "travar",
|
||||
"treino", "tremer", "trepidar", "trevo", "triagem", "tribo", "triciclo", "tridente", "trilogia", "trindade",
|
||||
"triplo", "triturar", "triunfal", "trocar", "trombeta", "trova", "trunfo", "truque", "tubular", "tucano", "tudo",
|
||||
"tulipa", "tupi", "turbo", "turma", "turquesa", "tutelar", "tutorial", "uivar", "umbigo", "unha", "unidade",
|
||||
"uniforme", "urologia", "urso", "urtiga", "urubu", "usado", "usina", "usufruir", "vacina", "vadiar", "vagaroso",
|
||||
"vaidoso", "vala", "valente", "validade", "valores", "vantagem", "vaqueiro", "varanda", "vareta", "varrer",
|
||||
"vascular", "vasilha", "vassoura", "vazar", "vazio", "veado", "vedar", "vegetar", "veicular", "veleiro", "velhice",
|
||||
"veludo", "vencedor", "vendaval", "venerar", "ventre", "verbal", "verdade", "vereador", "vergonha", "vermelho",
|
||||
"verniz", "versar", "vertente", "vespa", "vestido", "vetorial", "viaduto", "viagem", "viajar", "viatura",
|
||||
"vibrador", "videira", "vidraria", "viela", "viga", "vigente", "vigiar", "vigorar", "vilarejo", "vinco", "vinheta",
|
||||
"vinil", "violeta", "virada", "virtude", "visitar", "visto", "vitral", "viveiro", "vizinho", "voador", "voar",
|
||||
"vogal", "volante", "voleibol", "voltagem", "volumoso", "vontade", "vulto", "vuvuzela", "xadrez", "xarope", "xeque",
|
||||
"xeretar", "xerife", "xingar", "zangado", "zarpar", "zebu", "zelador", "zombar", "zoologia", "zumbido"]
|
||||
28
src/js/xwc-util.js
Normal file
28
src/js/xwc-util.js
Normal file
@@ -0,0 +1,28 @@
|
||||
function XWCbufferToAddress(pubBuf){
|
||||
const Buffer = libs.buffer.Buffer;
|
||||
const XWC_ADDRESS_PREFIX = "XWC";
|
||||
const XWC_NORMAL_ADDRESS_VERSION = "35"
|
||||
let addrData = libs.createHash("rmd160").update( libs.createHash("sha512").update(pubBuf).digest()).digest();
|
||||
let addrBuf = Buffer.concat([Buffer.from(XWC_NORMAL_ADDRESS_VERSION, "hex") ,addrData])
|
||||
let checksum = libs.createHash("rmd160").update(addrBuf).digest("hex").slice(0, 8);
|
||||
addrBuf = Buffer.concat([addrBuf, Buffer.from(checksum, "hex")]);
|
||||
return XWC_ADDRESS_PREFIX.concat(libs.bs58.encode(addrBuf));
|
||||
}
|
||||
|
||||
function XWCbufferToPublic(pubBuf) {
|
||||
const Buffer = libs.buffer.Buffer;
|
||||
const XWC_PUBLIC_PREFIX = "XWC";
|
||||
let checksum = libs.createHash("rmd160").update(pubBuf).digest("hex").slice(0, 8);
|
||||
pubBuf = Buffer.concat([pubBuf, Buffer.from(checksum, "hex")]);
|
||||
return XWC_PUBLIC_PREFIX.concat(libs.bs58.encode(pubBuf));
|
||||
}
|
||||
|
||||
function XWCbufferToPrivate(privBuf) {
|
||||
const Buffer = libs.buffer.Buffer;
|
||||
const XWC_PRIVATE_PREFIX = "80";
|
||||
privBuf = Buffer.concat([Buffer.from(XWC_PRIVATE_PREFIX, "hex"), privBuf]);
|
||||
let tmp = libs.createHash("sha256").update(privBuf).digest();
|
||||
let checksum = libs.createHash("sha256").update(tmp).digest("hex").slice(0, 8);
|
||||
privBuf = Buffer.concat([privBuf, Buffer.from(checksum, "hex")]);
|
||||
return libs.bs58.encode(privBuf);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
501
tests/package-lock.json
generated
Normal file
501
tests/package-lock.json
generated
Normal file
@@ -0,0 +1,501 @@
|
||||
{
|
||||
"name": "tests",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "tests",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jasmine": "^3.9.0",
|
||||
"selenium-webdriver": "^3.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||
},
|
||||
"node_modules/core-util-is": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
|
||||
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
|
||||
},
|
||||
"node_modules/fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||
},
|
||||
"node_modules/glob": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
|
||||
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/immediate": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
|
||||
"integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps="
|
||||
},
|
||||
"node_modules/inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"dependencies": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
},
|
||||
"node_modules/isarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
|
||||
},
|
||||
"node_modules/jasmine": {
|
||||
"version": "3.9.0",
|
||||
"resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.9.0.tgz",
|
||||
"integrity": "sha512-JgtzteG7xnqZZ51fg7N2/wiQmXon09szkALcRMTgCMX4u/m17gVJFjObnvw5FXkZOWuweHPaPRVB6DI2uN0wVA==",
|
||||
"dependencies": {
|
||||
"glob": "^7.1.6",
|
||||
"jasmine-core": "~3.9.0"
|
||||
},
|
||||
"bin": {
|
||||
"jasmine": "bin/jasmine.js"
|
||||
}
|
||||
},
|
||||
"node_modules/jasmine-core": {
|
||||
"version": "3.9.0",
|
||||
"resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.9.0.tgz",
|
||||
"integrity": "sha512-Tv3kVbPCGVrjsnHBZ38NsPU3sDOtNa0XmbG2baiyJqdb5/SPpDO6GVwJYtUryl6KB4q1Ssckwg612ES9Z0dreQ=="
|
||||
},
|
||||
"node_modules/jszip": {
|
||||
"version": "3.7.1",
|
||||
"resolved": "https://registry.npmjs.org/jszip/-/jszip-3.7.1.tgz",
|
||||
"integrity": "sha512-ghL0tz1XG9ZEmRMcEN2vt7xabrDdqHHeykgARpmZ0BiIctWxM47Vt63ZO2dnp4QYt/xJVLLy5Zv1l/xRdh2byg==",
|
||||
"dependencies": {
|
||||
"lie": "~3.3.0",
|
||||
"pako": "~1.0.2",
|
||||
"readable-stream": "~2.3.6",
|
||||
"set-immediate-shim": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/lie": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
|
||||
"integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
|
||||
"dependencies": {
|
||||
"immediate": "~3.0.5"
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/pako": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
|
||||
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
|
||||
},
|
||||
"node_modules/path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/process-nextick-args": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
|
||||
},
|
||||
"node_modules/readable-stream": {
|
||||
"version": "2.3.7",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
|
||||
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
|
||||
"dependencies": {
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.3",
|
||||
"isarray": "~1.0.0",
|
||||
"process-nextick-args": "~2.0.0",
|
||||
"safe-buffer": "~5.1.1",
|
||||
"string_decoder": "~1.1.1",
|
||||
"util-deprecate": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/rimraf": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
|
||||
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
|
||||
"dependencies": {
|
||||
"glob": "^7.1.3"
|
||||
},
|
||||
"bin": {
|
||||
"rimraf": "bin.js"
|
||||
}
|
||||
},
|
||||
"node_modules/safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
},
|
||||
"node_modules/sax": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
||||
},
|
||||
"node_modules/selenium-webdriver": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-3.6.0.tgz",
|
||||
"integrity": "sha512-WH7Aldse+2P5bbFBO4Gle/nuQOdVwpHMTL6raL3uuBj/vPG07k6uzt3aiahu352ONBr5xXh0hDlM3LhtXPOC4Q==",
|
||||
"dependencies": {
|
||||
"jszip": "^3.1.3",
|
||||
"rimraf": "^2.5.4",
|
||||
"tmp": "0.0.30",
|
||||
"xml2js": "^0.4.17"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/set-immediate-shim": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz",
|
||||
"integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/string_decoder": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
||||
"dependencies": {
|
||||
"safe-buffer": "~5.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/tmp": {
|
||||
"version": "0.0.30",
|
||||
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.30.tgz",
|
||||
"integrity": "sha1-ckGdSovn1s51FI/YsyTlk6cRwu0=",
|
||||
"dependencies": {
|
||||
"os-tmpdir": "~1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
},
|
||||
"node_modules/xml2js": {
|
||||
"version": "0.4.23",
|
||||
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
|
||||
"integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
|
||||
"dependencies": {
|
||||
"sax": ">=0.6.0",
|
||||
"xmlbuilder": "~11.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/xmlbuilder": {
|
||||
"version": "11.0.1",
|
||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
|
||||
"integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
|
||||
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
|
||||
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"immediate": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
|
||||
"integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps="
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"requires": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
},
|
||||
"isarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
|
||||
},
|
||||
"jasmine": {
|
||||
"version": "3.9.0",
|
||||
"resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.9.0.tgz",
|
||||
"integrity": "sha512-JgtzteG7xnqZZ51fg7N2/wiQmXon09szkALcRMTgCMX4u/m17gVJFjObnvw5FXkZOWuweHPaPRVB6DI2uN0wVA==",
|
||||
"requires": {
|
||||
"glob": "^7.1.6",
|
||||
"jasmine-core": "~3.9.0"
|
||||
}
|
||||
},
|
||||
"jasmine-core": {
|
||||
"version": "3.9.0",
|
||||
"resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.9.0.tgz",
|
||||
"integrity": "sha512-Tv3kVbPCGVrjsnHBZ38NsPU3sDOtNa0XmbG2baiyJqdb5/SPpDO6GVwJYtUryl6KB4q1Ssckwg612ES9Z0dreQ=="
|
||||
},
|
||||
"jszip": {
|
||||
"version": "3.7.1",
|
||||
"resolved": "https://registry.npmjs.org/jszip/-/jszip-3.7.1.tgz",
|
||||
"integrity": "sha512-ghL0tz1XG9ZEmRMcEN2vt7xabrDdqHHeykgARpmZ0BiIctWxM47Vt63ZO2dnp4QYt/xJVLLy5Zv1l/xRdh2byg==",
|
||||
"requires": {
|
||||
"lie": "~3.3.0",
|
||||
"pako": "~1.0.2",
|
||||
"readable-stream": "~2.3.6",
|
||||
"set-immediate-shim": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"lie": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
|
||||
"integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
|
||||
"requires": {
|
||||
"immediate": "~3.0.5"
|
||||
}
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
|
||||
},
|
||||
"pako": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
|
||||
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "2.3.7",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
|
||||
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
|
||||
"requires": {
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.3",
|
||||
"isarray": "~1.0.0",
|
||||
"process-nextick-args": "~2.0.0",
|
||||
"safe-buffer": "~5.1.1",
|
||||
"string_decoder": "~1.1.1",
|
||||
"util-deprecate": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
|
||||
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
|
||||
"requires": {
|
||||
"glob": "^7.1.3"
|
||||
}
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
},
|
||||
"sax": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
||||
},
|
||||
"selenium-webdriver": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-3.6.0.tgz",
|
||||
"integrity": "sha512-WH7Aldse+2P5bbFBO4Gle/nuQOdVwpHMTL6raL3uuBj/vPG07k6uzt3aiahu352ONBr5xXh0hDlM3LhtXPOC4Q==",
|
||||
"requires": {
|
||||
"jszip": "^3.1.3",
|
||||
"rimraf": "^2.5.4",
|
||||
"tmp": "0.0.30",
|
||||
"xml2js": "^0.4.17"
|
||||
}
|
||||
},
|
||||
"set-immediate-shim": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz",
|
||||
"integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E="
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
||||
"requires": {
|
||||
"safe-buffer": "~5.1.0"
|
||||
}
|
||||
},
|
||||
"tmp": {
|
||||
"version": "0.0.30",
|
||||
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.30.tgz",
|
||||
"integrity": "sha1-ckGdSovn1s51FI/YsyTlk6cRwu0=",
|
||||
"requires": {
|
||||
"os-tmpdir": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
},
|
||||
"xml2js": {
|
||||
"version": "0.4.23",
|
||||
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
|
||||
"integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
|
||||
"requires": {
|
||||
"sax": ">=0.6.0",
|
||||
"xmlbuilder": "~11.0.0"
|
||||
}
|
||||
},
|
||||
"xmlbuilder": {
|
||||
"version": "11.0.1",
|
||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
|
||||
"integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA=="
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "tests",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"test": "node tests.js"
|
||||
"test": "jasmine spec/tests.js"
|
||||
},
|
||||
"author": "Ian coleman",
|
||||
"description": "Tests for BIP39 tool",
|
||||
@@ -11,6 +11,7 @@
|
||||
"url": "git://github.com/iancoleman/bip39.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"jasmine": "^3.9.0",
|
||||
"selenium-webdriver": "^3.6.0"
|
||||
},
|
||||
"license": "MIT"
|
||||
|
||||
1513
tests/spec/tests.js
1513
tests/spec/tests.js
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user