Created
August 22, 2020 00:30
-
-
Save michaelrhodes/20c6a7dfc812d35cd5afb05860c8b68e to your computer and use it in GitHub Desktop.
convert an ipv4 address into its uint32 representation
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
ipv4.split('.').reduce((sum, num, ndx, arr) => sum + (num * Math.pow(256, arr.length - 1 - ndx)), 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment