mirror of
https://github.com/meshtastic/python.git
synced 2026-09-14 22:39:18 -04:00
rename to generate_channel_hash
This commit is contained in:
1 parent
471e3ce145
commit
a17cfe9d2b
2 files changed
+3
-3
No files matched your search
+2
-2
@@ -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({
|
||||
|
||||
+1
-1
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user