mirror of
https://github.com/573dev/gfdm-server.git
synced 2026-07-17 09:01:48 -05:00
Clean up utils (still need more)
This commit is contained in:
parent
3fe53599eb
commit
f43eee8553
2
TODO.txt
Normal file
2
TODO.txt
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
- Implement proper logging (is there some sort of flask logging, or should I just log to a file?)
|
||||
- Add typing
|
||||
|
|
@ -5,7 +5,7 @@ from Crypto.Hash import MD5
|
|||
class EamuseARC4(object):
|
||||
def __init__(self, eamuse_key):
|
||||
# fmt: off
|
||||
self.internal_key = bytearray([
|
||||
internal_key = bytearray([
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x69, 0xd7,
|
||||
0x46, 0x27, 0xd9, 0x85, 0xee, 0x21, 0x87, 0x16,
|
||||
0x15, 0x70, 0xd0, 0x8d, 0x93, 0xb1, 0x24, 0x55,
|
||||
|
|
@ -13,8 +13,8 @@ class EamuseARC4(object):
|
|||
])
|
||||
# fmt: on
|
||||
|
||||
self.key = MD5.new(eamuse_key + self.internal_key[6:]).digest()
|
||||
self.arc = ARC4.new(self.key)
|
||||
key = MD5.new(eamuse_key + internal_key[6:]).digest()
|
||||
self.arc = ARC4.new(key)
|
||||
|
||||
def decrypt(self, data):
|
||||
return self.arc.decrypt(bytes(data))
|
||||
|
|
|
|||
|
|
@ -2,4 +2,7 @@ from time import time
|
|||
|
||||
|
||||
def get_timestamp() -> str:
|
||||
"""
|
||||
Make a timestamp int for logging purposes
|
||||
"""
|
||||
return str(int(round(time() * 1000)))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user