mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-12 03:27:06 +10:00
fix case-sensitive prefix
This commit is contained in:
@@ -6385,10 +6385,12 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
}
|
||||
|
||||
bool _contactKeyMatchesPrefix(String contactKeyHex, List<int> pubkeyPrefix) {
|
||||
final prefixHex = pubkeyPrefix
|
||||
.map((b) => b.toRadixString(16).padLeft(2, '0'))
|
||||
// Normalize both sides to upper-case hex to avoid case-sensitive mismatches.
|
||||
final normalizedPrefixHex = pubkeyPrefix
|
||||
.map((b) => b.toRadixString(16).padLeft(2, '0').toUpperCase())
|
||||
.join();
|
||||
return contactKeyHex.startsWith(prefixHex);
|
||||
final normalizedContactKeyHex = contactKeyHex.toUpperCase();
|
||||
return normalizedContactKeyHex.startsWith(normalizedPrefixHex);
|
||||
}
|
||||
|
||||
void _handleAutoAddConfig(Uint8List frame) {
|
||||
|
||||
Reference in New Issue
Block a user