Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For Uint8Array in Type script #31

Open
Lizard-King101 opened this issue May 5, 2021 · 0 comments
Open

For Uint8Array in Type script #31

Lizard-King101 opened this issue May 5, 2021 · 0 comments

Comments

@Lizard-King101
Copy link

This took me way to long to figure out. In order to pass a Uint8Array to functions that need the normal node Buffer Uint8Array Type you must convert to unknown type and then Uint8Array type.

let hexstring = "572f3c5e8167f8b2cacba8036b9b37c3cc48b6a349ebbac561eec0089d222451";
let uint8arraytype = <Uint8Array><unknown>Buffer.from(hexstring, 'hex');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant