mirror of
https://github.com/meshtastic/python.git
synced 2026-09-15 06:52:41 -04:00
tidy up the autobot
This commit is contained in:
1 parent
c44f9b1bb4
commit
d2d9c03bc8
1 file changed
+5
-5
+5
-5
@@ -21,11 +21,11 @@ from meshtastic.util import (
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
def xor_hash(data: bytes) -> int:
|
||||
"""Simple XOR hash for demonstration (replace with your actual implementation)."""
|
||||
h = 0
|
||||
for b in data:
|
||||
h ^= b
|
||||
return h
|
||||
"""Compute an XOR hash from bytes."""
|
||||
result = 0
|
||||
for char in data:
|
||||
result ^= char
|
||||
return result
|
||||
|
||||
def generate_hash(name: str, key_bytes: bytes) -> int:
|
||||
"""Generate the channel number by hashing the channel name and psk bytes."""
|
||||
|
||||
Reference in new issue
Block a user