JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://rawgithub.com/nodeca/pako/master/dist/pako.js"></script>
<div id="choice">
</div>
<script type="http-cache">HTTP/1.1 200 OK
Date: Fri, 20 May 2016 19:42:46 GMT
Server: Apache/2.4.9 (Win64) PHP/5.5.12
Last-Modified: Sat, 12 Mar 2011 20:04:52 GMT
ETag: "b7e-49e4e976d4100-gzip"
Accept-Ranges: bytes
Cache-Control: max-age=18000
Expires: Sat, 21 May 2016 00:42:46 GMT
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 1021
Content-Type: application/javascript; charset=utf-8
</script>
<script type="http-cache">00000000: 1f 8b 08 00 00 00 00 00 00 03 a5 56 4d 6f e3 36 ...........VMo.6
00000010: 10 3d db 80 ff c3 84 c1 02 52 63 4b de b4 e8 21 .=.......RcK...!
00000020: ae 51 a0 2d 8a a2 d8 5d 14 4d 8f 7b a1 25 da 26 .Q.-...].M.{.%.&
00000030: 42 51 02 49 25 eb ed fa bf 77 86 14 6d c9 8e b3 BQ.I%....w..m...
00000040: 1f 3d d8 94 c8 99 37 c3 37 8f 43 4d c6 8f dc 40 .=....7.7.CM...@
00000050: c3 8b 07 61 60 09 5a 3c c1 5f fe 65 31 19 4f c6 ...a`.Z<._.e1.O.
00000060: f4 ba e2 56 dc 66 7f de ff 92 fd dd 2a f1 46 5a ...V.f......*.FZ
00000070: 97 fc 3b 19 8f d8 f5 ba 36 15 bb 03 7a 19 d5 ba ..;.....6...z...
00000080: ac 8b b6 12 da 19 c1 cb dd 1d ac 5b 5d 38 59 eb ...........[]8Y.
00000090: 24 0d 06 23 b7 95 36 33 a2 aa 1f c5 af 8a 5b 9b $..#..63......[.
000000a0: b0 52 5a be 52 a2 64 e9 c2 5b d4 ad 6b 5a 97 3d .RZ.R.d..[..kZ.=
000000b0: 72 d5 0a 4c 85 b1 45 df 11 51 93 60 b8 9f d2 3f r..L..E..Q.`...?
000000c0: fd 2e c5 aa 84 b5 7c 23 b2 27 23 9d 48 98 37 8b ......|#.'#.H.7.
000000d0: 51 a4 a6 20 6b cc d6 46 3c fc f3 98 ec da 2f 4e Q.. k..F<...../N
000000e0: af 43 26 71 6f 31 4f 0c c4 95 15 3e ba 6d 84 52 .C&qo1O....>.m.R
000000f0: c5 56 14 0f dd 2c e4 39 20 21 50 d5 1f a5 52 fc .V...,.9 !P...R.
00000100: 08 59 28 c1 cd 8c 2b f5 12 5c a0 b0 50 d2 e3 9d .Y(...+..\..P...
00000110: 6e 27 a4 7c ca cb 05 ba da 46 d5 bc bc 2f 8c 6c n'.|.....F.../.l
00000120: 5c 66 dd 4e 89 0c 23 36 8a ef 7a 46 5f 60 32 c0 ...
CSS
#hidden {
display: none;
}
pre {
display: none;
}
JavaScript
////////////////////////////////////////////////////////////////////////////////////////
// Big Integer Library v. 5.5
// Created 2000, last modified 2013
// Leemon Baird
// www.leemon.com
//
// Version history:
// v 5.5 17 Mar 2013
// - two lines of a form like "if (x<0) x+=n" had the "if" changed to "while" to
// handle the case when x<-n. (Thanks to James Ansell for finding that bug)
// v 5.4 3 Oct 2009
// - added "var i" to greaterShift() so i is not global. (Thanks to PŽter Szab— for finding that bug)
//
// v 5.3 21 Sep 2009
// - added randProbPrime(k) for probable primes
// - unrolled loop in mont_ (slightly faster)
// - millerRabin now takes a bigInt parameter rather than an int
//
// v 5.2 15 Sep 2009
// - fixed capitalization in call to int2bigInt in randBigInt
// (thanks to Emili Evripidou, Reinhold Behringer, and Samuel Macaleese for finding that bug)
//
// v 5.1 8 Oct 2007
// - renamed inverseModInt_ to inverseModInt since it doesn't change its parameters
// - added functions GCD and randBigInt, which call GCD_ and randBigInt_
// - fixed a bug found by Rob Visser (see comment with his name below)
// - improved comments
//
// This file is public domain. You can use it for any purpose without restriction.
// I do not guarantee that it is correct, so use it at your own risk. If you use
// it for something interesting, I'd appreciate hearing about it. If you find
// any bugs or make any improvements, I'd appreciate hearing about those too.
// It would also be nice if my name and URL were left in the comments. But none
// of that is required.
//
// This code defines a bigInt library for arbitrary-precision integers.
// A bigInt is an array of integers storing the value in chunks of bpe bits,
// little endian (buff[0] is the least significant word).
// Negative bigInts are stored two's complement. Almost all the functions treat
// bigInts as nonnegative. The few that view them as two's complement say so
// in...