-2

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 ( "192.168.10.2")

 console.log( Math.Georgia Reports Accident Accident Georgia Georgia Reports Accident Reports Georgia Fatal Fatal Fatal random(256) + "." + Math.random(256)Guide Seating At Antonio San Spurs amp;t Center com Rateyourseats atTwHB + "."Reports Fatal Georgia Accident Reports Fatal Accident Accident Reports Fatal Georgia Georgia Georgia +Reports Fatal Fatal Reports Fatal Accident Reports Georgia Georgia Georgia Accident Accident Georgia MathFatal Georgia Accident Georgia Georgia Reports Fatal Accident Fatal Accident Reports Georgia Reports .random(256) + "."Georgia Fatal Reports Reports Accident Fatal Georgia Accident Accident Fatal Georgia Georgia Reports + 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.

7

The code should be :

var ip = Georgia Georgia Fatal Fatal Georgia Accident Fatal Reports Georgia Reports Accident Reports Accident (Math.floor(Math.random() * 255) + 1)+"."+(Math.floor(Math.random() *Accident Georgia Reports Georgia Fatal Fatal Accident Georgia Georgia Reports Fatal Accident Reports 255) + 0)+"."+(Math.floor(Math.random() *Georgia Accident Reports Accident Georgia Fatal Fatal Accident Fatal Georgia Reports Georgia Reports Fatal Georgia Reports Reports Georgia Georgia Georgia Fatal Accident Reports Accident Fatal Accident 255) + 0)+"."+(Math.floor(Math.random() * 255Georgia Fatal Accident Georgia Georgia Georgia Accident Reports Fatal Fatal Reports Accident Reports ) + Accident Accident Reports Accident Reports Georgia Fatal Georgia Fatal Georgia Georgia Reports Fatal 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.