src/utils/webapi.js

This commit is contained in:
CounterFire2023 2024-04-14 20:06:20 +08:00
parent 5c4d3186d8
commit c125a488c8

View File

@ -35,10 +35,9 @@ const httpGet = async (url) => {
const base58Alphabet = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
export const hexToBase58 = (hexString) => {
const bytes = hexString.match(/.{1,2}/g).map(byte => parseInt(byte, 16));
hexString.match(/.{1,2}/g).map(byte => parseInt(byte, 16));
let base58String = '';
// eslint-disable-next-line no-undef
let num = BigInt('0x' + hexString);
while (num > 0n) {
const remainder = num % 58n;