MCPcopy Index your code
hub / github.com/techfort/LokiJS / genRandomVal

Function genRandomVal

benchmark/benchmark_binary.js:30–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28 getIterations = 2000000; // get is crazy fast due to binary search so this needs separate scale
29
30function genRandomVal() {
31 var text = "";
32 var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
33
34 for (var i = 0; i < 20; i++)
35 text += possible.charAt(Math.floor(Math.random() * possible.length));
36
37 return text;
38}
39
40// in addition to the loki id we will create a key of our own
41// (customId) which is number from 1- totalIterations

Callers 2

initializeDatabaseFunction · 0.70
initializeDatabaseBatchFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected