mirror of
https://github.com/meshtastic/python.git
synced 2026-01-02 21:07:55 -05:00
rename to generate_channel_hash
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -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