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.Relating The Of President Correspondence Ltd From Equifax European random(256) + "." + Math.random(256)For Roadside Smartphone Law Driver Licenses On Implications 's A 0OznBxwUq + "."Ltd From Equifax The Of Correspondence European President Relating +Equifax Correspondence From The Of President Relating European Ltd MathRelating Of The Correspondence Equifax From Ltd President European .random(256) + "."Of Equifax Correspondence European The President Relating From Ltd + 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 = The Relating Ltd European Correspondence Of From Equifax President (Math.floor(Math.random() * 255) + 1)+"."+(Math.floor(Math.random() *Correspondence European From The Relating Equifax President Ltd Of 255) + 0)+"."+(Math.floor(Math.random() *Relating From European President Correspondence Of The Equifax Ltd Ltd Relating From Equifax European The Of President Correspondence 255) + 0)+"."+(Math.floor(Math.random() * 255The Equifax Ltd President Of From Relating European Correspondence ) + Ltd Correspondence From Equifax Of The President Relating European 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.