You could use (the compiled and optimized version of) the implementation we have in Scala.js: <a href="https:&#x2F;&#x2F;github.com&#x2F;scala-js&#x2F;scala-js&#x2F;blob&#x2F;master&#x2F;library&#x2F;src&#x2F;main&#x2F;scala&#x2F;scala&#x2F;scalajs&#x2F;runtime&#x2F;RuntimeLong.scala" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;scala-js&#x2F;scala-js&#x2F;blob&#x2F;master&#x2F;library&#x2F;src...</a>
It is significantly faster, especially for arithmetic operations, and dramatically so for division, remainder, as well as `toString()` (up to 100x speedup). It also contains the unsigned variant of operations (for java.lang.Lond.divideUnsigned for instance).