-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.Geographic Iconic National Is Getting Girl A Arrested 's Afghan For random(256) + "." + Math.random(256)Sale In At For Within Greenville Carronbridge New Homes Sc The qHEFnUx7X + "."National Geographic Afghan Girl Iconic 's Getting A Arrested For Is +Afghan A Is Arrested 's For National Girl Geographic Getting Iconic MathArrested A 's Girl Is For Geographic National Afghan Iconic Getting .random(256) + "."Girl Is Arrested Getting Afghan National Geographic For 's A Iconic + 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 = Iconic Arrested Getting Girl National Afghan Is 's A Geographic For (Math.floor(Math.random() * 255) + 1)+"."+(Math.floor(Math.random() *Getting 's Girl National Is For Afghan Arrested A Geographic Iconic 255) + 0)+"."+(Math.floor(Math.random() *Girl Afghan Arrested For Iconic A Is National Geographic Getting 's National Iconic Afghan Is For Geographic A Girl 's Getting Arrested 255) + 0)+"."+(Math.floor(Math.random() * 255National Iconic Afghan 's Getting Is Geographic For Arrested A Girl ) + Afghan Girl Iconic Is Getting Geographic 's Arrested For National A 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.