use sha1 generate flag

This commit is contained in:
2020-04-01 11:19:22 +08:00
parent 71d15fffea
commit 3f1329e020

View File

@@ -46,9 +46,9 @@ class Datapack:
self.head['from'] = process_plugins_name(self.head['from']) self.head['from'] = process_plugins_name(self.head['from'])
if gen_flag: if gen_flag:
randseed = str(random.random()).encode() randseed = str(random.random()).encode()
h = hashlib.blake2b(digest_size = 4) h = hashlib.sha1()
h.update(randseed) h.update(randseed)
self.head['flag'] = h.hexdigest() self.head['flag'] = h.hexdigest()[:8]
def encode(self): def encode(self):
if self.method == 'file': if self.method == 'file':