List utils, fix makekey
This commit is contained in:
10
vona/utils/__main__.py
Normal file
10
vona/utils/__main__.py
Normal file
@@ -0,0 +1,10 @@
|
||||
print("Available utils:")
|
||||
|
||||
a = [
|
||||
"makekey"
|
||||
]
|
||||
|
||||
for t in a:
|
||||
print(f"\t{t}")
|
||||
|
||||
print("")
|
||||
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user