Skip to content

Instantly share code, notes, and snippets.

Created December 17, 2017 22:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ArisBee/c82197c9333cd680572fa97ff73acc67 to your computer and use it in GitHub Desktop.
A Google App Script function (javascript) to check if an IP address belongs to a given range.
function isInRange(ip, firstRangeIp, lastRangeIp)
var ipArr = ip.split(".");
var firstArr = firstRangeIp.split(".");
var lastArr = lastRangeIp.split(".");
var pos = 0
return false;
else if (Number(ipArr[i])==Number(firstArr[i])) pos=i;
return false;
return true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment