mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-10-09 19:55:05 +00:00
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XPovRHpejR4zRxuhjY4Qs3
19 lines
371 B
Dart
19 lines
371 B
Dart
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);
|
|
}
|