Help for this page

Select Code to Download


  1. or download this
        my $id = shift;
        # disallow ID 0;
        $id > 0 && $id < 1e9 or return q();
        $id = sprintf '%0*lu', ($id < 1e6 ? 6 : 9), $id;
        ...
    
  2. or download this
    sub id2path {
        my $id = shift;
    ...
        # or: substr($id, $_, 0, '/') for -2*$n, -$n;
        return $id;
    }