mirror of
https://github.com/perfect-panel/ppanel-web.git
synced 2026-02-06 11:40:28 -05:00
12 lines
328 B
TypeScript
12 lines
328 B
TypeScript
import { uid } from 'radash';
|
|
|
|
/**
|
|
* Generate a random password
|
|
* @param length Length of the password
|
|
* @param charset Character set to use (defaults to alphanumeric)
|
|
* @returns Randomly generated password
|
|
*/
|
|
export function generatePassword(length = 16, charset?: string) {
|
|
return uid(length, charset).toLowerCase();
|
|
}
|