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

Can we convert big number to Integer of fixed length ? #131

Open
SethiShivam opened this issue Jul 8, 2021 · 1 comment
Open

Can we convert big number to Integer of fixed length ? #131

SethiShivam opened this issue Jul 8, 2021 · 1 comment

Comments

@SethiShivam
Copy link

There is a method called bignum.toBuffer() . Can we use this function to convert big number to buffer of fixed length like we can do in python using *int.to_bytes(length, byteorder, , signed=False)

I want to implement this in my js code where i want to convert big num to buffer but of fixed length.

Best Regards
Sethi Shivam

@Abhishek-thakur1
Copy link

yes, you can by using bignum.toBuffer(size, { size: 8 })

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

2 participants