#!/usr/bin/php > 6) & 0x3f]; if ($i++ >= $count) { break; } if ($i < $count) { $value |= ord($input[$i]) << 16; } $output .= $itoa64[($value >> 12) & 0x3f]; if ($i++ >= $count) { break; } $output .= $itoa64[($value >> 18) & 0x3f]; } while ($i < $count); return $output; } $script_name = array_shift($_SERVER['argv']); foreach ($_SERVER['argv'] as $hash) { $parts = explode(':', $hash); if (count($parts) == 4) { $itoa64 = _passwordhash_itoa64(); $output = '$P$'; $output .= $itoa64[$parts[1]]; $output .= $parts[2]; $output .= _passwordhash_encode64(base64_decode($parts[3]), 16); print $output ."\n"; } else { print "Error - please use a Drupal hash as the argument to the script"; } }