Skip to content

Commit 3446ced

Browse files
Ensure compliance with code quality checks (removed trailing spaces, fixed new lines)
1 parent b5bf570 commit 3446ced

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pydatastructs/graphs/graph.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def rotate_secret_key():
1313
os.environ["HMAC_SECRET_KEY"] = secrets.token_hex(32)
1414
time.sleep(30 * 24 * 60 * 60)
1515
def get_secret_key():
16-
""" Gets the HMAC secret key """
16+
"""Gets the HMAC secret key"""
1717
secret_key = os.getenv("HMAC_SECRET_KEY")
1818
if secret_key is None:
1919
try:
@@ -22,10 +22,10 @@ def get_secret_key():
2222
except FileNotFoundError:
2323
raise RuntimeError("Secret key is missing! Set HMAC_SECRET_KEY or create hmac_key.txt.")
2424
return secret_key.encode()
25-
25+
2626
def generate_hmac(data):
2727
"""Generating HMAC signature for integrity verification"""
28-
return hmac.new(get_secret_key(), data.encode(),hashlib.sha256).hexdigit()
28+
return hmac.new(get_secret_key(), data.encode(),hashlib.sha256).hexdigest()
2929
def serialize_graph(graph):
3030
"""Converts a graph into a string for HMAC signing."""
3131
if not graph.vertices or not graph.edge_weights:
@@ -228,4 +228,3 @@ def num_edges(self):
228228
raise NotImplementedError(
229229
"This is an abstract method.")
230230
threading.Thread(target=rotate_secret_key, daemon=True).start()
231-

0 commit comments

Comments
 (0)