fixed a footer bug, servertime changes!
This commit is contained in:
18
webserver.py
18
webserver.py
@@ -52,13 +52,13 @@ import random
|
|||||||
|
|
||||||
from hashes.hashes import hash_list
|
from hashes.hashes import hash_list
|
||||||
|
|
||||||
@lru_cache
|
# Generate hashes only once at server start
|
||||||
def index_footer():
|
H1 = random.choice(hash_list)
|
||||||
h1 = random.choice(hash_list)
|
H2_CANDIDATES = [h for h in hash_list if h != H1]
|
||||||
# Ensure h2 is different from h1
|
H2 = random.choice(H2_CANDIDATES) if H2_CANDIDATES else H1
|
||||||
h2_candidates = [h for h in hash_list if h != h1]
|
|
||||||
h2 = random.choice(h2_candidates) if h2_candidates else h1
|
|
||||||
|
|
||||||
|
# cahcing was a bad, idea, servertime got stuck. it is now a variable ;)
|
||||||
|
def index_footer():
|
||||||
return f"""
|
return f"""
|
||||||
<footer style="
|
<footer style="
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -67,9 +67,9 @@ def index_footer():
|
|||||||
">
|
">
|
||||||
<hr style="border: 1px solid #ccc;" />
|
<hr style="border: 1px solid #ccc;" />
|
||||||
<p>
|
<p>
|
||||||
Server-Time (CET): <i>{time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())}</i><br />
|
Server-Time (CET ; GMT+2): <i>{time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())}</i><br />
|
||||||
Hash 1 (<b>UTF-8</b>)<i>:{base64.b64encode(h1.encode("utf-8")).decode("utf-8")}</i><br />
|
Hash 1 (<b>UTF-8</b>)<i>:{base64.b64encode(H1.encode("utf-8")).decode("utf-8")}</i><br />
|
||||||
Hash 2 (<b>Windows-1252</b>)<i>:{base64.b64encode(h2.encode("windows-1252")).decode("windows-1252")}</i><br />
|
Hash 2 (<b>Windows-1252</b>)<i>:{base64.b64encode(H2.encode("windows-1252")).decode("windows-1252")}</i><br />
|
||||||
</p>
|
</p>
|
||||||
</footer>
|
</footer>
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user