Intro テストや仮実装で、適当なランダム文字列が欲しい場合に便利なスニペット。 random string DEMO // with random btoa(Math.random()) // => MC44NzEwODQwMjA1NDA2MTE4 // with crypto btoa(crypto.getRandomValues(new Uint8Array(16))) // => MjQ2LDE0NSwxNzAsMjQ0LDY4LDg3LDMzLDE0NiwxNzcsNjAsMTUyLDE3MSwxNTAsMTcsMTA4LDEwNA== // base64 has `=` remove them btoa(Math.random()).replace(/=/g, "") // => MC45NTM0NTM2OTY3MTc5MDY0 // lower case btoa(Math
![ブラウザで適当なランダム文字列 | blog.jxck.io](https://cdn-ak-scissors.b.st-hatena.com/image/square/25f705929f7e98ea08f049f3c57b5de57a1b3ba0/height=288;version=1;width=512/https%3A%2F%2Fblog.jxck.io%2Fassets%2Fimg%2Fjxck.600x600.png)