Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Problem creating PrivateKey from Uint8Array in browser #216

Open
k06a opened this issue Mar 11, 2018 · 0 comments
Open

Problem creating PrivateKey from Uint8Array in browser #216

k06a opened this issue Mar 11, 2018 · 0 comments

Comments

@k06a
Copy link

k06a commented Mar 11, 2018

Trying to create PrivateKey from Uint8Array in browser:

const pk = new bitcore.crypto.BN("FE58A7A926DB562F1B9E00F488B9A2B9CD84DF606B544DAB97077CA04806702B", 16);
const arr = new Uint8Array(pk.toArray());
new bitcore.PrivateKey(arr);

n

Looks like it is decoded internally into very strange BN:

00000000000000000254c88c167c169c38c219c86c47c27c158c0c244c136c185c162c185c205c132c223c96c107c84c77c171c151c7c124c160c72c6c112c43

I just wanna achieve uncompressed WIF format instead of compressed and noticed Uint8Array argument leads to compressed = false.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant