Update: Generate 16-character salt starting with lowercase letter in pow_generator.py

main
TiredFromTelehack 2024-10-18 03:17:26 +02:00
parent e3384b4485
commit ca2c13e4c8
1 changed files with 6 additions and 3 deletions

View File

@ -1,9 +1,12 @@
import random import random
import string import string
def generate_salt(length=16): def generate_salt():
# Generate a salt with alphanumeric characters (A-Z, a-z, 0-9) # Ensure the first character after "SALT" is a lowercase letter
return 'SALT' + ''.join(random.choices(string.ascii_letters + string.digits, k=length)) first_char = random.choice(string.ascii_lowercase)
# Generate the remaining characters (11 more to make a total of 16)
remaining_chars = ''.join(random.choices(string.ascii_letters + string.digits, k=11))
return 'SALT' + first_char + remaining_chars
def generate_proof_of_work(): def generate_proof_of_work():
# Set fixed memory cost and difficulty # Set fixed memory cost and difficulty