function needs_rehash($hash, $cost = self::COST) { list($pwcost) = sscanf($hash, "\$2y\$%d\$"); return $pwcost < $cost; }