We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c44f9b1 commit d2d9c03Copy full SHA for d2d9c03
meshtastic/node.py
@@ -21,11 +21,11 @@
21
logger = logging.getLogger(__name__)
22
23
def xor_hash(data: bytes) -> int:
24
- """Simple XOR hash for demonstration (replace with your actual implementation)."""
25
- h = 0
26
- for b in data:
27
- h ^= b
28
- return h
+ """Compute an XOR hash from bytes."""
+ result = 0
+ for char in data:
+ result ^= char
+ return result
29
30
def generate_hash(name: str, key_bytes: bytes) -> int:
31
"""Generate the channel number by hashing the channel name and psk bytes."""
0 commit comments