public static function generateSalt($length)
    {
        mt_srand(intval(microtime(true)*100000 + memory_get_usage(true)));
        return substr(sha1(uniqid(mt_rand(), true)), 0, $length);
    }
public static function generateSalt($length)
    {
        mt_srand(intval(microtime(true)*100000 + memory_get_usage(true)));
        return substr(sha1(uniqid(mt_rand(), true)), 0, $length);
    }
public static function generateSalt ( $ length ) { mt_srand ( intval ( microtime ( true ) * 100000 + memory_get_usage ( true ) ) ) ; return substr ( sha1 ( uniqid ( mt_rand ( ) , true ) ) , 0 , $ length ) ; }
Generates a salt to be used in message digestation.

@param integer $length
the length of the salt
@return string
a hexadecimal string
Generates a salt to be used in message digestation .