Help for this page

Select Code to Download


  1. or download this
    sub xor_it_together {
      my @ip = shift =~ /(\d+)/g;
      my $code = join'^',@ip;
    ...
    }
    # xor_it_together('67.167.26.54') --> 200
    # xor_it_together('127.0.0.1') --> 126
    
  2. or download this
    use List::Util "sum";
    sub ip2rgb {
    ...
    }
    # ip2rgb '220.17.120.164' --> 17, 11, 120
    # ip2rgb '127.0.0.1' --> 126, 128, 0