Created
April 27, 2013 23:35
-
-
Save randallb/5475192 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var numberConv; | |
numberConv = function(x) { | |
var octet1, octet2, octet3, octet4; | |
octet1 = x % 256; | |
octet2 = Math.floor(x / 256); | |
octet3 = Math.floor(x / (256 * 256)); | |
octet4 = Math.floor(x / (256 * 256 * 256)); | |
return new Buffer([octet1, octet2, octet3, octet4]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment