mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-11 16:30:28 +00:00
Add custom cave map mode
This commit is contained in:
18
lib/utils/custom_map_id.dart
Normal file
18
lib/utils/custom_map_id.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
const int customMapKey6HexLength = 12;
|
||||
|
||||
String? normalizeCustomMapId(String? mapId) {
|
||||
if (mapId == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final normalized = mapId.trim().toLowerCase();
|
||||
if (normalized.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (normalized.length <= customMapKey6HexLength) {
|
||||
return normalized;
|
||||
}
|
||||
|
||||
return normalized.substring(0, customMapKey6HexLength);
|
||||
}
|
||||
Reference in New Issue
Block a user