-
-
Save qustosh/5294435 to your computer and use it in GitHub Desktop.
IPv4 to Numeric Value
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
"192.168.1.1".split('.').reverse.map(_.toLong).zipWithIndex.map(t => (t._1 << (t._2 * 8L))).reduce(_ | _) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment