Skip to content

Commit

Permalink
Add passcode() alias for otp() to test the name
Browse files Browse the repository at this point in the history
  • Loading branch information
valorin committed Jan 2, 2024
1 parent ebc7e54 commit 145af61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ public function otp(int $length = 6): string
return $this->string($length, $lower = false, $upper = false, $numbers = true, $symbols = false, $requireAll = false);
}

/**
* @alias otp()
*/
public function passcode(int $length = 6): string
{
return $this->otp($length);
}

/**
* Generate a random string of $length lowercase and uppercase letters.
*
Expand Down
3 changes: 1 addition & 2 deletions src/Random.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

namespace Valorin\Random;

use Illuminate\Support\Collection;

/**
* @see \Valorin\Random\Generator
*
* @method static int number(int $min, int $max) Generate a random number between $min and $max, inclusive.
* @method static string string(int $length = 32, bool $lower = true, bool $upper = true, bool $numbers = true, bool $symbols = true, bool $requireAll = false) Generate a random string of $length characters, following the specified character rules.
* @method static string otp(int $length = 6) Generate a numeric One-Time Password (OTP) of $length digits, suitable for use in 2FA.
* @method static string passcode(int $length = 6) Generate a numeric One-Time Password (OTP) of $length digits, suitable for use in 2FA.
* @method static string letters(int $length = 32) Generate a random string of $length lowercase and uppercase letters.
* @method static string token(int $length = 32) Generate a random string of $length which includes lowercase and uppercase letters, and numbers.
* @method static string password(int $length = 32, bool $requireAll = false) Generate a random password string of $length which includes lowercase and uppercase letters, numbers, and symbols.
Expand Down

0 comments on commit 145af61

Please sign in to comment.