-
-
Notifications
You must be signed in to change notification settings - Fork 599
Qt_script_ip2int
Paweł Salawa edited this page Apr 13, 2021
·
1 revision
Language: | Qt Script |
---|---|
Plugin for language: | ScriptingQt |
How to use: | Create custom SQL function. Suggested name: ip2int |
Function arguments | Keep undefined |
Function usage: | select ip2int('192.168.0.1'); |
Description: | Converts X.X.X.X representation of IPv4 to the integer representation. |
The code:
return arguments[0].split('.').reduce(function(ipInt, octet) { return (ipInt<<8) + parseInt(octet, 10)}, 0) >>> 0;