List utils, fix makekey

This commit is contained in:
2025-10-07 00:23:52 -04:00
parent 6268ea67b0
commit 6709b91d35
2 changed files with 28 additions and 2 deletions

View File

@@ -3,7 +3,23 @@
import base64
import os
key = base64.b64encode(os.urandom(32)).decode("utf-8")[:43].replace("/", "_")
key_id = base64.b64encode(os.urandom(32)).decode("utf-8")[:6].replace("/", "_")
def mkchar() -> str:
return os.urandom(4).hex()[:1]
key = (
base64.b64encode(os.urandom(32))
.decode("utf-8")[:43]
.replace("/", mkchar())
.replace("+", mkchar())
)
key_id = (
base64.b64encode(os.urandom(32))
.decode("utf-8")[:6]
.replace("/", mkchar())
.replace("+", mkchar())
)
print(f"ed25519 {key_id} {key}")