The Codebase Consistency Update
This commit is contained in:
@@ -8,4 +8,4 @@ a = [
|
||||
for t in a:
|
||||
print(f"\t{t}")
|
||||
|
||||
print("")
|
||||
print("")
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
import urllib.parse, time, json, httpx
|
||||
import vona.globals as globals
|
||||
import vona.config as config
|
||||
|
||||
import urllib.parse
|
||||
import time
|
||||
import json
|
||||
import httpx
|
||||
|
||||
|
||||
http_client = globals.http_client()
|
||||
|
||||
versions = [
|
||||
|
||||
@@ -1,25 +1,23 @@
|
||||
# Generates a key in the format compatible with Synapse and Vona.
|
||||
|
||||
import base64
|
||||
import os
|
||||
|
||||
# Generates a key in the format compatible with Synapse and Vona.
|
||||
|
||||
|
||||
def mkchar() -> str:
|
||||
return os.urandom(4).hex()[:1]
|
||||
|
||||
|
||||
key = (
|
||||
base64.b64encode(os.urandom(32))
|
||||
.decode("utf-8")[:43]
|
||||
.replace("/", mkchar())
|
||||
.replace("+", mkchar())
|
||||
)
|
||||
def random(length):
|
||||
return (
|
||||
base64.b64encode(os.urandom(length))
|
||||
.decode("utf-8")[:length]
|
||||
.replace("/", mkchar())
|
||||
.replace("+", mkchar())
|
||||
)
|
||||
|
||||
key_id = (
|
||||
base64.b64encode(os.urandom(32))
|
||||
.decode("utf-8")[:6]
|
||||
.replace("/", mkchar())
|
||||
.replace("+", mkchar())
|
||||
)
|
||||
|
||||
key = random(43)
|
||||
key_id = random(6)
|
||||
|
||||
print(f"ed25519 {key_id} {key}")
|
||||
|
||||
Reference in New Issue
Block a user