andyperlitch / jsbn

The jsbn library is a fast, portable implementation of large-number math in pure JavaScript, enabling public-key crypto and other applications on desktop and mobile browsers.
Other
167 stars 41 forks source link

FIXED: to work with frozen Object.prototype #25

Closed andvgal closed 1 year ago

andvgal commented 6 years ago

If Object.prototype is frozen then "toString" cannot be overridden by assignment.

Workaround is assign most of BigInteger API in single place using feature of JS "var".

Also, the overall size is reduced by ~1.5K

P.S. Tested with ip-address module as there are no dedicated tests.