Skip to content

Commit

Permalink
Create utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Dec 1, 2024
1 parent b5af024 commit b70f128
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/wallet/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import json

def save_to_file(data, filename):
with open(filename, 'w') as f:
json.dump(data, f)
print(f"Data saved to {filename}.")

def load_from_file(filename):
with open(filename, 'r') as f:
data = json.load(f)
print(f"Data loaded from {filename}.")
return data

def generate_unique_id():
return secrets.token_hex(16) # Generate a unique transaction ID

0 comments on commit b70f128

Please sign in to comment.