This question already has an answer here:

  • 26 answers

I am trying to create fake IP address using the following javascript random method. But not works.

any one help me to get the correct way to do this?

here is my try: I am looking like ( "")

 console.log( Math.Kcsr Page The 37 City Android Kansas Megathread Forum archive random(256) + "." + Math.random(256)Los Begins � News Rush As Traffic Holiday Lax Cbs At Heavy Angeles Z41zqwYq + "."37 Kansas Forum City Page Kcsr The Megathread archive Android +archive Page Megathread 37 Kcsr Android Kansas City Forum The Math37 Kcsr Forum Android Kansas City Megathread Page archive The .random(256) + "."archive City Kansas Kcsr Page Android Forum Megathread 37 The + Math.random(256) );

marked as duplicate by John3136, JJJ, T.J. Crowder Apr 18 '17 at 5:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


The code should be :

var ip = City 37 Kcsr archive Page The Megathread Android Kansas Forum (Math.floor(Math.random() * 255) + 1)+"."+(Math.floor(Math.random() *Forum Page Android 37 Kansas Megathread City archive Kcsr The 255) + 0)+"."+(Math.floor(Math.random() *Page 37 Forum Android Kansas Megathread The City Kcsr archive Page The Kansas archive City 37 Kcsr Android Megathread Forum 255) + 0)+"."+(Math.floor(Math.random() * 255Megathread archive Kansas Page Forum Kcsr Android City The 37 ) + archive Page Kcsr The 37 City Kansas Forum Megathread Android 0); console.log(ip)

The code (Math.floor(Math.random() * 255) + 1) means generate a random number between 1 and 255.

Not the answer you're looking for? Browse other questions tagged or ask your own question.