Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* CS

git-svn-id: http://svn.php.net/repository/pear/packages/Text_Password/trunk@122316 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
commit 88192d11df403f5685ad883e530dfc45d8992035 1 parent 80faa66
Martin Jansen mj authored
Showing with 28 additions and 28 deletions.
  1. +28 −28 Password.php
56 Password.php
View
@@ -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) {
@@ -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) {
@@ -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);
@@ -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;
@@ -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++) {
@@ -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);
@@ -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);
@@ -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);
@@ -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++) {
@@ -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++) {
@@ -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--) {
@@ -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++) {
@@ -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 = '';
/**
@@ -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 = '';
Please sign in to comment.
Something went wrong with that request. Please try again.