This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
[ | |
["esc", "1", "2", "3", "/", "\\", "fn","del"], | |
[ "⇥", "4", "5", "6", "[", "]", "'", "⇦"], | |
[ "`", "7", "8", "9", "0", "-", "=", ";"], | |
[ "q", "j", "l", "m", "f", "y", "p", "↩"], | |
[ "z", ".", "o", "r", "s", "u", "c", "b"], | |
[ "x", "a", "e", "h", "t", "d", "g", "k"], | |
[ "↥", ",", "i", "n", "w", "v", "↑", "↥"], | |
["ctr","sup","alt", " ", " ", "←", "↓", "→"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const count = 10e6 | |
const length = 100 | |
console.time('generate') | |
const chars = Array(52).fill().map((_, i) => String.fromCharCode(i < 26 ? i + 65 : i + 71)) | |
const char = () => chars[Math.random() * chars.length | 0] | |
const triplets = chars.flatMap(a => chars.flatMap(b => chars.flatMap(c => [a, b, c].join('')))) | |
const triplet = () => triplets[Math.random() * triplets.length | 0] | |
const main = Array(Math.floor(length / 3)).fill(0) | |
const tail = Array(length - main.length * 3).fill(0) |
OlderNewer