Created
October 27, 2016 01:36
-
-
Save etale/6ce9876e6d02f4f38f2baedcbf08adb0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let toUint8Array = (a, p = 0x100, isBig = true) => ( | |
a.isZero ? new Uint8Array : | |
(([q, r]) => ( | |
new Uint8Array( | |
isBig | |
? [...toUint8Array(q, p, isBig), r] | |
: [r, ...toUint8Array(q, p, isBig)] | |
) | |
)) | |
(a.divmod(p)) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment