Permalink
Browse files

tidy up docs for use with li_docs

  • Loading branch information...
1 parent a7dfd0e commit 1b6b0355597613d11ddd1056d2946f7200d6a469 @ddebernardy ddebernardy committed with nateabele Aug 31, 2010
Showing with 11 additions and 10 deletions.
  1. +2 −2 libraries/lithium/security/Crypto.php
  2. +9 −8 libraries/lithium/security/Password.php
@@ -37,7 +37,7 @@ class Crypto {
* }}}
*
* @param integer $bytes The number of random bytes to generate
- * @param string Random bytes
+ * @return string Random bytes
*/
public static function random($bytes) {
$source = static::$_source ?: static::_source();
@@ -99,7 +99,7 @@ public static function encode64($input) {
* speaking, this fallback is inadequate, but good enough.)
*
* @return Closure The random number generator.
- **/
+ */
protected static function _source() {
switch (true) {
case isset(static::$_source);
@@ -66,7 +66,7 @@ class Password extends \lithium\security\Crypto {
* - 34 chars long for MD5 hashes
* @see lithium\security\Password::check()
* @see lithium\security\Password::genSalt()
- **/
+ */
public static function hash($password, $salt = null) {
return crypt($password, $salt ?: static::genSalt());
}
@@ -79,7 +79,7 @@ public static function hash($password, $salt = null) {
* @return boolean Whether the password is correct or not
* @see lithium\security\Password::hash()
* @see lithium\security\Password::genSalt()
- **/
+ */
public static function check($password, $hash) {
return $hash == crypt($password, $hash);
}
@@ -106,8 +106,8 @@ public static function check($password, $hash) {
* (e.g. `md5(microtime())`) in that it uses all of the available bits of
* entropy for the supplied salt method.
*
- * Note2: this method should not be to generate custom salts. Indeed, the
- * resulting salts are prefixed with information expected by PHP's
+ * Note2: this method should not be use to generate custom salts. Indeed,
+ * the resulting salts are prefixed with information expected by PHP's
* `crypt()`. To get an arbitrarily long, cryptographically strong salt
* consisting in random sequences of alpha numeric characters, use
* `lithium\security\Crypto::random()` instead.
@@ -127,7 +127,8 @@ public static function check($password, $hash) {
* @link http://www.postgresql.org/docs/9.0/static/pgcrypto.html
* @see lithium\security\Password::hash()
* @see lithium\security\Password::check()
- **/
+ * @see lithium\security\Crypto::random()
+ */
public static function genSalt($type = null, $count = null) {
switch (true) {
case CRYPT_BLOWFISH == 1 && (!$type || $type === 'bf'):
@@ -144,8 +145,8 @@ public static function genSalt($type = null, $count = null) {
*
* @param integer $count The base-2 logarithm of the iteration count.
* Defaults to `10`. Can be `4` to `31`.
- * @return string $salt
- **/
+ * @return string The Blowfish salt
+ */
protected static function _genSaltBf($count = 10) {
$count = (integer) $count;
if ($count < 4 || $count > 31)
@@ -220,7 +221,7 @@ protected static function _genSaltXDES($count = 18) {
* Generates an MD5 salt for use in `lithium\security\Password::hash()`.
*
* @return string The MD5 salt.
- **/
+ */
protected static function _genSaltMD5() {
$output = '$1$'
// 48 bits of salt

0 comments on commit 1b6b035

Please sign in to comment.