Simplify base58 dependency tree (#624)

This commit is contained in:
Jaco Greeff
2020-07-02 07:26:04 +02:00
committed by GitHub
parent 92f88222c4
commit 7115efd94f
5 changed files with 19 additions and 27 deletions
-2
View File
@@ -32,7 +32,6 @@
"bip39": "^3.0.2",
"blakejs": "^1.1.0",
"bn.js": "^5.1.2",
"bs58": "^4.0.1",
"elliptic": "^6.5.3",
"js-sha3": "^0.8.0",
"pbkdf2": "^3.1.1",
@@ -41,7 +40,6 @@
},
"devDependencies": {
"@types/bn.js": "^4.11.6",
"@types/bs58": "^4.0.1",
"@types/elliptic": "^6.4.12",
"@types/pbkdf2": "^3.0.0",
"@types/xxhashjs": "^0.2.2"
+15
View File
@@ -0,0 +1,15 @@
// Copyright 2017-2020 @polkadot/util-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import baseX from 'base-x';
// https://github.com/cryptocoinjs/base-x#alphabets
const BASE58_ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
const bs58 = baseX(BASE58_ALPHABET);
export {
BASE58_ALPHABET,
bs58
};
+1 -3
View File
@@ -2,11 +2,9 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import bs58 from 'bs58';
import { bufferToU8a } from '@polkadot/util';
// copied from bs58
const BASE58_ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
import { BASE58_ALPHABET, bs58 } from './bs58';
/**
* @name base58Decode
+2 -1
View File
@@ -2,9 +2,10 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import bs58 from 'bs58';
import { u8aToBuffer, u8aToU8a } from '@polkadot/util';
import { bs58 } from './bs58';
/**
* @name base58Encode
* @summary Creates a base58 value.
+1 -21
View File
@@ -2770,7 +2770,6 @@ __metadata:
"@polkadot/util": 2.17.0-beta.0
"@polkadot/wasm-crypto": ^1.2.1
"@types/bn.js": ^4.11.6
"@types/bs58": ^4.0.1
"@types/elliptic": ^6.4.12
"@types/pbkdf2": ^3.0.0
"@types/xxhashjs": ^0.2.2
@@ -2778,7 +2777,6 @@ __metadata:
bip39: ^3.0.2
blakejs: ^1.1.0
bn.js: ^5.1.2
bs58: ^4.0.1
elliptic: ^6.5.3
js-sha3: ^0.8.0
pbkdf2: ^3.1.1
@@ -2893,15 +2891,6 @@ __metadata:
languageName: node
linkType: hard
"@types/bs58@npm:^4.0.1":
version: 4.0.1
resolution: "@types/bs58@npm:4.0.1"
dependencies:
base-x: ^3.0.6
checksum: 3/0fc89f90f50c3b86aa633fbb12dad0a37a2b2aff5e6ec50995ebce9d88f768a950afbbc43c7e1a10943a0991374892924346218f3dd0d7dfad108e09bc564a2f
languageName: node
linkType: hard
"@types/chrome@npm:^0.0.117":
version: 0.0.117
resolution: "@types/chrome@npm:0.0.117"
@@ -4580,7 +4569,7 @@ __metadata:
languageName: node
linkType: hard
"base-x@npm:^3.0.2, base-x@npm:^3.0.6, base-x@npm:^3.0.8":
"base-x@npm:^3.0.8":
version: 3.0.8
resolution: "base-x@npm:3.0.8"
dependencies:
@@ -4939,15 +4928,6 @@ __metadata:
languageName: node
linkType: hard
"bs58@npm:^4.0.1":
version: 4.0.1
resolution: "bs58@npm:4.0.1"
dependencies:
base-x: ^3.0.2
checksum: 3/0da897a0e527b31ec0fd7ce4d84a86278196acb4fa4f5010dce38a7b83b8b0bbe26909843878c2aa32bdbe00b93a68408d42c74a1cfaa05ca64f29bd5dff4187
languageName: node
linkType: hard
"bser@npm:2.1.1":
version: 2.1.1
resolution: "bser@npm:2.1.1"