Skip to content
On this page

getRandomStr

获取随机唯一字符串

Usage

js
import { getRandomStr } from '@morehook/utils'

const key = getRandomStr()

Type Declarations

typescript
/**
 * 获取唯一的随机字符串
 * @param randomLength 生成的随机字符串长度(最高为12)
 * @return 11位或者12位的字符串,当randomLength小于11时不保证唯一性
 */
export declare function getRandomStr(randomLength?: number): string

Source

SourceDocs