Post
Topic
Board Off-topic
Re: password generator site
by
Paperweight
on 07/08/2020, 19:21:44 UTC
Guys, guys! If you need to generate random passwords just use the goddamn command line.

From the Mac or Linux terminal:
Code:
LC_ALL=C tr -cd \!-~ < /dev/urandom | head -c 42

From Windows Powershell:
Code:
[Reflection.Assembly]::LoadWithPartialName("System.Web")
[System.Web.Security.Membership]::GeneratePassword(42, 0)

And if you INSIST on doing it from a web browser, just copy-paste this into a text file and rename it random.html
Code:
<script>
var bytes = new Uint8Array(420);
window.crypto.getRandomValues(bytes); // supposed to be cryptographically secure
document.write(
  [...bytes]
  .filter(x => 33 <= x && x <= 126) // filter out non-ascii character codes
  .map(x => String.fromCharCode(x)) // map character codes to characters
  .join('')                         // join characters into string
);
</script>