11import * as exodus from '../base58.js'
22import { benchmark } from '@exodus/test/benchmark' // eslint-disable-line @exodus/import/no-unresolved
33import { base58 as scure } from '@scure/base'
4+ import * as base58js from 'base58-js'
45import bs58 from 'bs58'
56import { base58 as bstring } from 'bstring'
67import buffer from 'buffer/index.js'
@@ -14,6 +15,7 @@ import { Table } from './utils/table.js'
1415const 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
0 commit comments