https://github.com/serprex/openEtG/blob/2011007dec2616d1a24d...
Tho I could probably save binary size more by importing Math.sqrt from JS