What are the general principles for working with large integers in javascript? Like in libraries for bigint? How do I do it myself?
You can take a look at this implementation . You can also find other implementations .
Another option that I used in the past is to transfer these operations to the calculation server via jsonp. If you work with such large numbers, you probably want to improve the performance and accuracy that this can give you.