MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / randomstring

Function randomstring

framework/utils/lib/common.ts:14–18  ·  view source on GitHub ↗
(digit = 32, dict = defaultDict)

Source from the content-addressed store, hash-verified

12const defaultDict = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
13
14export function randomstring(digit = 32, dict = defaultDict) {
15 let str = '';
16 for (let i = 1; i <= digit; i++) str += dict[Math.floor(Math.random() * dict.length)];
17 return str;
18}
19
20String.prototype.format ||= function formatStr(...args) {
21 let result = this;

Callers 15

upgrade.tsFile · 0.90
runMethod · 0.90
setting.tsFile · 0.90
setPasswordMethod · 0.90
createMethod · 0.90
addMethod · 0.90
postUploadFileMethod · 0.90
postMethod · 0.90
postUploadFileMethod · 0.90
config.tsFile · 0.90
applyFunction · 0.85
fromFileMethod · 0.85

Calls 1

randomMethod · 0.80

Tested by

no test coverage detected