mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-22 16:08:00 +00:00
ec06da0ebc
- Package namespace: @polkadot/* -> @pezkuwi/* - Repository: polkadot-js/common -> pezkuwichain/pezkuwi-common - Author: Pezkuwi Team <team@pezkuwichain.io> Core packages: - @pezkuwi/util (utilities) - @pezkuwi/util-crypto (crypto primitives) - @pezkuwi/keyring (account management) - @pezkuwi/networks (chain metadata) - @pezkuwi/hw-ledger (Ledger hardware wallet) - @pezkuwi/x-* (10 polyfill packages) Total: 14 packages Upstream: polkadot-js/common v14.0.1
32 lines
942 B
TypeScript
32 lines
942 B
TypeScript
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
|
|
|
import { base32Decode } from '../base32/index.js';
|
|
import { base58Decode } from './index.js';
|
|
|
|
describe('base58Encode', (): void => {
|
|
it('decodes an empty string)', (): void => {
|
|
expect(
|
|
base58Decode('')
|
|
).toEqual(new Uint8Array());
|
|
});
|
|
|
|
it('encodes a base58 to a base32', (): void => {
|
|
expect(
|
|
base58Decode('b2rhk6GMPQF3hfzwXTaNYFLKomMeC6UXdUt6jZKPpeVirLtV')
|
|
).toEqual(
|
|
base32Decode('afkreigh2akiscaildcqabsyg3dfr6chu3fgpregiymsck7e7aqa4s52zy')
|
|
);
|
|
});
|
|
|
|
it('encodes a base58 to a base32 (ipfs-compat)', (): void => {
|
|
expect(
|
|
base58Decode('zb2rhk6GMPQF3hfzwXTaNYFLKomMeC6UXdUt6jZKPpeVirLtV', true)
|
|
).toEqual(
|
|
base32Decode('bafkreigh2akiscaildcqabsyg3dfr6chu3fgpregiymsck7e7aqa4s52zy', true)
|
|
);
|
|
});
|
|
});
|