Last active
May 21, 2018 16:18
-
-
Save slikts/cd7a73a0e651cbf01ab7d2d13457311a 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
const numberToRawBinary = n => { | |
const data = new DataView(new ArrayBuffer(8)); | |
data.setFloat64(0, n); | |
return Array.from(new Uint8Array(data.buffer), x => | |
x.toString(2).padStart(8, 0) | |
).join(""); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment