rename to generate_channel_hash

This commit is contained in:
SpudGunMan
2025-11-06 12:01:53 -08:00
parent 471e3ce145
commit a17cfe9d2b
2 changed files with 3 additions and 3 deletions

View File

@@ -16,7 +16,7 @@ from meshtastic.util import (
pskToString,
stripnl,
message_to_json,
generate_hash,
generate_channel_hash,
)
logger = logging.getLogger(__name__)
@@ -1051,7 +1051,7 @@ class Node:
if self.channels:
for c in self.channels:
if c.settings and hasattr(c.settings, "name") and hasattr(c.settings, "psk"):
hash_val = generate_hash(c.settings.name, c.settings.psk)
hash_val = generate_channel_hash(c.settings.name, c.settings.psk)
else:
hash_val = None
result.append({

View File

@@ -372,7 +372,7 @@ def channel_hash(data: bytes) -> int:
result ^= char
return
def generate_hash(name, key) -> int:
def generate_channel_hash(name, key) -> int:
"""generate the channel number by hashing the channel name and psk (accepts str or bytes for both)"""
# Handle key as str or bytes
if isinstance(key, bytes):