Skip to content

Commit ef7adc6

Browse files
committed
bench: add base58-js to comparison
1 parent 68ec708 commit ef7adc6

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

benchmarks/base58.bench.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as exodus from '../base58.js'
22
import { benchmark } from '@exodus/test/benchmark' // eslint-disable-line @exodus/import/no-unresolved
33
import { base58 as scure } from '@scure/base'
4+
import * as base58js from 'base58-js'
45
import bs58 from 'bs58'
56
import { base58 as bstring } from 'bstring'
67
import buffer from 'buffer/index.js'
@@ -14,6 +15,7 @@ import { Table } from './utils/table.js'
1415
const columns = [
1516
'@exodus/bytes/base58',
1617
'scure.base58',
18+
'base58-js',
1719
'bs58',
1820
'bstring', // native
1921
]
@@ -37,6 +39,7 @@ describe('benchmarks: base58', async () => {
3739
['@exodus/bytes/base58', (x) => exodus.toBase58(x)],
3840
['bs58', (x) => bs58.encode(x)],
3941
['scure.base58', (x) => scure.encode(x)],
42+
['base58-js', (x) => base58js.binary_to_base58(x)],
4043
['bstring', (x) => bstring.encode(toBuffer(x))],
4144
]
4245

@@ -45,6 +48,7 @@ describe('benchmarks: base58', async () => {
4548
['@exodus/bytes/base58', (x) => exodus.fromBase58(x)],
4649
['bs58', (x) => bs58.decode(x)],
4750
['scure.base58', (x) => scure.decode(x)],
51+
['base58-js', (x) => base58js.base58_to_binary(x)],
4852
['bstring', (x) => bstring.decode(x)],
4953
]
5054

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
"@types/node": "^22.13.0",
133133
"base-x": "^5.0.1",
134134
"base32.js": "^0.1.0",
135+
"base58-js": "^3.0.3",
135136
"base64-js": "^1.5.1",
136137
"bech32": "^2.0.0",
137138
"bs58": "^6.0.0",

pnpm-lock.yaml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)