aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Osipenko <[email protected]>2011-12-28 11:43:46 +0200
committerAlexey Osipenko <[email protected]>2011-12-28 13:31:42 +0200
commitb20572fb810b61dc445ef31d4af5d0df4bdadb86 (patch)
tree93f02fb1dab25cd893590755d690c9e341b64aea
parentcea0735c9a118179623eba9b10df49dde7c6963b (diff)
downloadfaker-b20572fb810b61dc445ef31d4af5d0df4bdadb86.tar.xz
faker-b20572fb810b61dc445ef31d4af5d0df4bdadb86.zip
Internet.ip
-rw-r--r--lib/internet.js15
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(".");
+};