function bitcoinDecode(value) {
        const buffer = decodeBase58(value);
        const privateKey = new Uint8Array(32);
        const checksum = new Uint8Array(4);
        // const prefix = buffer[0];
        privateKey.set(buffer.slice(1, 33));
        if (value[0] !== "5") {
          // compressed
          checksum.set(buffer.slice(34, 38));
        } else {
          checksum.set(buffer.slice(33, 37));
        }
        // TODO: verify prefix and checksum
        return privateKey;
      }
/**
       * Decodes a public or private key formatted in base58 using
       * the bitcoin format (see [Bitcoin Base58Check encoding](https://en.bitcoin.it/wiki/Base58Check_encoding)
       * and [Bitcoin WIF](https://en.bitcoin.it/wiki/Wallet_import_format)).
       *
       * For private keys this encode is also known as
       * wallet import format (WIF).
       */
Decodes a public or private key formatted in base58 using
the bitcoin format
and [Bitcoin WIF]).

For private keys this encode is also known as
wallet import format (WIF).
Decodes a public or private key formatted in base58 using the bitcoin format and [ Bitcoin WIF ] ) . For private keys this encode is also known as wallet import format ( WIF ) .
function bitcoinDecode(value) {
        const buffer = decodeBase58(value);
        const privateKey = new Uint8Array(32);
        const checksum = new Uint8Array(4);
        privateKey.set(buffer.slice(1, 33));
        if (value[0] !== "5") {
          checksum.set(buffer.slice(34, 38));
        } else {
          checksum.set(buffer.slice(33, 37));
        }
        return privateKey;
      }
function bitcoinDecode ( value ) { const buffer = decodeBase58 ( value ) ; const privateKey = new Uint8Array ( 32 ) ; const checksum = new Uint8Array ( 4 ) ; privateKey . set ( buffer . slice ( 1 , 33 ) ) ; if ( value [ 0 ] !== "5" ) { checksum . set ( buffer . slice ( 34 , 38 ) ) ; } else { checksum . set ( buffer . slice ( 33 , 37 ) ) ; } return privateKey ; }
Decodes a public or private key formatted in base58 using
 the bitcoin format (see [Bitcoin Base58Check encoding](https://en.bitcoin.it/wiki/Base58Check_encoding)
 and [Bitcoin WIF](https://en.bitcoin.it/wiki/Wallet_import_format)).
Decodes a public or private key formatted in base58 using the bitcoin format ( see [ Bitcoin Base58Check encoding ] ( https : // en . bitcoin . it / wiki / Base58Check_encoding ) and [ Bitcoin WIF ] ( https : // en . bitcoin . it / wiki / Wallet_import_format )) .
// const prefix = buffer[0]; // compressed // TODO: verify prefix and checksum