diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/internet.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/internet.js b/lib/internet.js index 82c48e0d..e3c48fec 100644 --- a/lib/internet.js +++ b/lib/internet.js @@ -23,4 +23,17 @@ exports.domainName = function() { exports.domainWord = function() { return Helpers.randomize(definitions.first_name()).toLowerCase(); -}
\ No newline at end of file +}; + +exports.ip = function() { + var randNum = function() { + return (Math.random()*254 + 1).toFixed(0); + } + + var result = []; + for(var i=0; i<4; i++) { + result[i] = randNum(); + } + + return result.join("."); +}; |
