mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: remove channel disambiguation suffix
This commit is contained in:
parent
a3a914abce
commit
ee61b79aa3
3 changed files with 5 additions and 20 deletions
|
|
@ -73,21 +73,6 @@ data class Channel(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a name that is formatted as #channename-suffix
|
||||
*
|
||||
* Where suffix indicates the hash of the PSK
|
||||
*/
|
||||
val humanName: String
|
||||
get() {
|
||||
// start with the PSK then xor in the name
|
||||
val pskCode = xorHash(psk.toByteArray())
|
||||
val nameCode = xorHash(name.toByteArray())
|
||||
val suffix = 'A' + ((pskCode xor nameCode) % 26)
|
||||
|
||||
return "#${name}-${suffix}"
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a channel name and psk, return the (0 to 255) hash for that channel
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue