Skip to content

Instantly share code, notes, and snippets.

@TLMcode
Last active December 20, 2015 02:48
Show Gist options
  • Save TLMcode/6058642 to your computer and use it in GitHub Desktop.
Save TLMcode/6058642 to your computer and use it in GitHub Desktop.
IP to Integer (Hex, Decimal formats)
msgbox % IPToInt("64.190.207.31", "H")
; params ip >> format (Hex, Decimal)
msgbox % 1+1
IPToInt(ip, fmt)
{
RegExMatch(ip,"(\d+)\D+(\d+)\D+(\d+)\D+(\d+)",oct_)
SetFormat, Integer, % fmt
Int:=(oct_1*(256**3))+(oct_2*(256**2))+(oct_3*256)+oct_4
SetFormat, Integer, D
Return Int
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment