Skip to content

Commit a17cfe9

Browse files
committed
rename to generate_channel_hash
1 parent 471e3ce commit a17cfe9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

meshtastic/node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
pskToString,
1717
stripnl,
1818
message_to_json,
19-
generate_hash,
19+
generate_channel_hash,
2020
)
2121

2222
logger = logging.getLogger(__name__)
@@ -1051,7 +1051,7 @@ def get_channels_with_hash(self):
10511051
if self.channels:
10521052
for c in self.channels:
10531053
if c.settings and hasattr(c.settings, "name") and hasattr(c.settings, "psk"):
1054-
hash_val = generate_hash(c.settings.name, c.settings.psk)
1054+
hash_val = generate_channel_hash(c.settings.name, c.settings.psk)
10551055
else:
10561056
hash_val = None
10571057
result.append({

meshtastic/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def channel_hash(data: bytes) -> int:
372372
result ^= char
373373
return
374374

375-
def generate_hash(name, key) -> int:
375+
def generate_channel_hash(name, key) -> int:
376376
"""generate the channel number by hashing the channel name and psk (accepts str or bytes for both)"""
377377
# Handle key as str or bytes
378378
if isinstance(key, bytes):

0 commit comments

Comments
 (0)