You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
447 B
25 lines
447 B
// () ~> HexString
|
|
const hexString = () => {
|
|
let str = "";
|
|
while (Math.random() < 0.95)
|
|
str = str + ("00" + (Math.random() * 256 | 0).toString(16)).slice(-2);
|
|
return "0x" + str;
|
|
}
|
|
|
|
// () ~> DataTree
|
|
const dataTree = () => {
|
|
let list = [];
|
|
while (Math.random() < 0.8) {
|
|
if (Math.random() < 0.8)
|
|
list.push(hexString());
|
|
else
|
|
list.push(dataTree());
|
|
}
|
|
return list;
|
|
}
|
|
|
|
module.exports = {
|
|
hexString,
|
|
dataTree
|
|
}
|