Guest User

Untitled

a guest
Jan 20th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. 1. To have a list of all IPs and then look for the resultant IP list
  2. 2. Use Nested Loop
  3.  
  4. IP Bytes -> Bits -> Int32
  5. From: 10.0.10.10 -> 00001010 00000000 00001010 00001010 -> 167774730
  6. To: 10.1.45.1 -> 00001010 00000001 00101101 00000001 -> 167849217
  7. Start count from From to To and just check the unwanted Bytes witch is 11111111 and 00000000
  8.  
  9. var startIp = 0x0A000001,
  10. endIp = 0x0A000F05;
  11.  
  12. var temp, list = [],str;
  13. for(var i=startIp ; i <= endIp ; i++){
  14. temp = (i).toString(16);
  15. str ='';
  16. if(temp.length == 7){
  17. temp = "0"+temp;
  18. }
  19.  
  20. for(var k=temp.length-1; k >= 0 ; k-=2){
  21.  
  22. str = parseInt(temp[k-1] + "" + temp[k], 16) +"." + str ;
  23.  
  24. }
  25. document.write(temp + " " + str+ "<br>");
  26. list.push(str.substring(0, str.length-1));
  27. }
  28.  
Add Comment
Please, Sign In to add comment