MCPcopy Create free account
hub / github.com/circircir-circle/human_exist_device / randString

Method randString

mini_program/common/Tools.js:52–63  ·  view source on GitHub ↗

* 生成字符串组合 * @param {Number} size * @return {String}

(size)

Source from the content-addressed store, hash-verified

50 * @return {String}
51 */
52 randString(size) {
53 let result = ''
54 let allChar = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
55
56 size = size || 1
57
58 while (size--) {
59 result += allChar.charAt(this.rand(0, allChar.length - 1))
60 }
61
62 return result
63 }
64
65 /**
66 * 生成文件名

Callers 1

randFilenameMethod · 0.95

Calls 1

randMethod · 0.95

Tested by

no test coverage detected