This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Uses built in ruby functions to handle conversions etc | |
| # Create 10 IPs | |
| for ips in 1...10 | |
| ip = "" | |
| #generate a random segment for each IP part (4 parts for each IP) | |
| for segment in 1...4 | |
| ip += rand(255).to_s(16).upcase | |
| end | |
| puts ip | |
| end |
NewerOlder