Update proof of work generation script to match specified salt format
parent
195d6108c7
commit
2ae7a067f4
|
@ -2,11 +2,19 @@ import random
|
||||||
import string
|
import string
|
||||||
|
|
||||||
def generate_salt():
|
def generate_salt():
|
||||||
# Ensure the first character after "SALT" is a lowercase letter
|
# Generate the salt in the specified format
|
||||||
first_char = random.choice(string.ascii_lowercase)
|
first_letter = random.choice(string.ascii_lowercase)
|
||||||
# Generate the remaining characters (11 more to make a total of 16), all lowercase
|
first_number = random.choice(string.digits)
|
||||||
remaining_chars = ''.join(random.choices(string.ascii_lowercase + string.digits, k=11))
|
second_letter = random.choice(string.ascii_lowercase)
|
||||||
return 'SALT' + first_char + remaining_chars
|
three_numbers1 = ''.join(random.choices(string.digits, k=3))
|
||||||
|
third_letter = random.choice(string.ascii_lowercase)
|
||||||
|
second_number = random.choice(string.digits)
|
||||||
|
fourth_letter = random.choice(string.ascii_lowercase)
|
||||||
|
three_numbers2 = ''.join(random.choices(string.digits, k=3))
|
||||||
|
|
||||||
|
# Combine to form the salt
|
||||||
|
salt = f"SALT{first_letter}{first_number}{second_letter}{three_numbers1}{third_letter}{second_number}{fourth_letter}{three_numbers2}"
|
||||||
|
return salt
|
||||||
|
|
||||||
def generate_proof_of_work():
|
def generate_proof_of_work():
|
||||||
# Set fixed memory cost and difficulty
|
# Set fixed memory cost and difficulty
|
||||||
|
|
Loading…
Reference in New Issue