add passw3ord

This commit is contained in:
CHIEFSOFT\ameye
2024-06-15 13:07:20 -04:00
parent 9c83100c38
commit 93c6ee9993
2 changed files with 18 additions and 3 deletions
+7
View File
@@ -131,5 +131,12 @@ abstract class BaseController extends Controller
return json_decode($result, true);
}
public function randomPassword( $length = 8 )
{
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?";
$length = rand(10, 16);
$password = substr( str_shuffle(sha1(rand() . time()) . $chars ), 0, $length );
return $password;
}
}