Function getKey

  • 获取带前/后缀的唯一 key

    Parameters

    • size: number = 21

      指定长度

    • Optionalprefix: string

      前缀

    • Optionalsuffix: string

    Returns string

    getKey(); /// 'M2rmCcGpXCa5MTdN4Kks5'
    getKey(2, 'test'); /// 'test-aK'
    getKey(2, null, 'last'); /// 'aK-last'