Created
February 17, 2017 19:25
-
-
Save vancluever/c0ba7895fd591facfb25b8a1485a4df1 to your computer and use it in GitHub Desktop.
IPv4 decimal to dotted quad conversion - https://jsfiddle.net/t7fu2fgy/ - works in Google Apps Script too
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
| function decimalToIPv4(decIpAddr) { | |
| ipBytes = []; | |
| for (i=0;i<=3;i++) { | |
| ipBytes.push((decIpAddr >> 8 * 3 - 8 * i) & 255); | |
| } | |
| return ipBytes.join("."); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment