Skip to content

Commit

Permalink
* CS
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.php.net/repository/pear/packages/Text_Password/trunk@122316 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
mj committed Apr 3, 2003
1 parent 80faa66 commit 88192d1
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class Text_Password {
* or numeric or alphanumeric.
* @return string Returns the generated password.
*/
function create($length = 10, $type = 'pronounceable', $chars = '') {

function create($length = 10, $type = 'pronounceable', $chars = '')
{
mt_srand((double) microtime() * 1000000);

switch ($type) {
Expand Down Expand Up @@ -74,8 +74,8 @@ function create($length = 10, $type = 'pronounceable', $chars = '') {
* or numeric or alphanumeric.
* @return array Array containing the passwords
*/
function createMultiple($number, $length = 10, $type = 'pronounceable', $chars = '') {

function createMultiple($number, $length = 10, $type = 'pronounceable', $chars = '')
{
$passwords = array();

while ($number > 0) {
Expand All @@ -102,8 +102,8 @@ function createMultiple($number, $length = 10, $type = 'pronounceable', $chars =
* @param integer Key
* @return string
*/
function createFromLogin($login, $type, $key = 0) {

function createFromLogin($login, $type, $key = 0)
{
switch ($type) {
case 'reverse':
return strrev($login);
Expand Down Expand Up @@ -148,8 +148,8 @@ function createFromLogin($login, $type, $key = 0) {
* @param integer Key
* @return array Array containing the passwords
*/
function createMultipleFromLogin($login, $type, $key = 0) {

function createMultipleFromLogin($login, $type, $key = 0)
{
$passwords = array();
$number = count($login);
$save = $number;
Expand Down Expand Up @@ -177,8 +177,8 @@ function createMultipleFromLogin($login, $type, $key = 0) {
* @param integer Key
* @return string
*/
function _xor($login, $key) {

function _xor($login, $key)
{
$tmp = '';

for ($i = 0; $i < strlen($login); $i++) {
Expand All @@ -205,8 +205,8 @@ function _xor($login, $key) {
* @param integer Key
* @return string
*/
function _rotx($login, $key) {

function _rotx($login, $key)
{
$tmp = '';
$login = strtolower($login);

Expand Down Expand Up @@ -238,8 +238,8 @@ function _rotx($login, $key) {
* @param integer Key
* @return string
*/
function _rotxpp($login, $key) {
function _rotxpp($login, $key)
{
$tmp = '';
$login = strtolower($login);

Expand Down Expand Up @@ -271,8 +271,8 @@ function _rotxpp($login, $key) {
* @param integer Key
* @return string
*/
function _rotxmm($login, $key) {
function _rotxmm($login, $key)
{
$tmp = '';
$login = strtolower($login);

Expand Down Expand Up @@ -303,8 +303,8 @@ function _rotxmm($login, $key) {
* @param integer Key
* @return string
*/
function _asciiRotx($login, $key) {

function _asciiRotx($login, $key)
{
$tmp = '';

for ($i = 0; $i < strlen($login); $i++) {
Expand All @@ -330,8 +330,8 @@ function _asciiRotx($login, $key) {
* @param integer Key
* @return string
*/
function _asciiRotxpp($login, $key) {
function _asciiRotxpp($login, $key)
{
$tmp = '';

for ($i = 0; $i < strlen($login); $i++, $key++) {
Expand All @@ -357,8 +357,8 @@ function _asciiRotxpp($login, $key) {
* @param integer Key
* @return string
*/
function _asciiRotxmm($login, $key) {
function _asciiRotxmm($login, $key)
{
$tmp = '';

for ($i = 0; $i < strlen($login); $i++, $key--) {
Expand All @@ -383,8 +383,8 @@ function _asciiRotxmm($login, $key) {
* @param string Login
* @return string
*/
function _shuffle($login) {

function _shuffle($login)
{
$tmp = array();

for ($i = 0; $i < strlen($login); $i++) {
Expand All @@ -406,10 +406,10 @@ function _shuffle($login) {
* @param integer Length of the password
* @return string Returns the password
*/
function _createPronounceable($length) {
function _createPronounceable($length)
{

global $_Text_Password_NumberOfPossibleCharacters;

$retVal = '';

/**
Expand Down Expand Up @@ -452,8 +452,8 @@ function _createPronounceable($length) {
* or numeric or alphanumeric.
* @return string Returns the password
*/
function _createUnpronounceable($length, $chars) {

function _createUnpronounceable($length, $chars)
{
global $_Text_Password_NumberOfPossibleCharacters;

$password = '';
Expand Down

0 comments on commit 88192d1

Please sign in to comment.