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

Replaces bignum with the built-in BigInt, adds TypeScript definitions #18

Merged
merged 4 commits into from
Aug 31, 2021

Conversation

znetstar
Copy link
Contributor

Made several changes but the most important was replacing bignum with the build-in BigInt so the package no longer depends on native modules (bignum depends on OpenSSL), so it can run in the browser.

BigInt was added in Node 10.24.1, so these change would break compatibility with Node versions earlier than that.

  • Replaced the bignum package with the built-in BigInt which was added in ES11, and updated lib/base85.js accordingly.
  • Added TypeScript definitions for lib/alphabets.js and lib/base85.js.
  • Replaced instances of new Buffer with Buffer.from or Buffer.alloc.
  • Added the buffer package so the Buffer class can be used outside of node (e.g., on the browser).
  • Changed the version in jshint to ES11.

@noseglid
Copy link
Owner

Amazing PR! Thank you @znetstar

@noseglid noseglid merged commit d7a48a3 into noseglid:master Aug 31, 2021
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

Successfully merging this pull request may close these issues.

2 participants