Skip to content

Instantly share code, notes, and snippets.

@sigsergv
Created February 3, 2015 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sigsergv/eb32602ba3558dce2358 to your computer and use it in GitHub Desktop.
Save sigsergv/eb32602ba3558dce2358 to your computer and use it in GitHub Desktop.
validator
function validator()
{
var allMasks = [
'240.0.0.0',
'248.0.0.0',
'252.0.0.0',
'254.0.0.0',
'255.0.0.0',
'255.128.0.0',
'255.192.0.0',
'255.224.0.0',
'255.240.0.0',
'255.248.0.0',
'255.252.0.0',
'255.254.0.0',
'255.255.0.0',
'255.255.128.0',
'255.255.192.0',
'255.255.224.0',
'255.255.240.0',
'255.255.248.0',
'255.255.252.0',
'255.255.254.0',
'255.255.255.0',
'255.255.255.128',
'255.255.255.192',
'255.255.255.224',
'255.255.255.240',
'255.255.255.248',
'255.255.255.252',
'255.255.255.255'];
if (allMasks.indexOf(value) != -1) {
return true;
} else {
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment