CodexUtils.cs
1 namespace CodexClient 2 { 3 public static class CodexUtils 4 { 5 public static string ToShortId(string id) 6 { 7 if (id.Length > 10) 8 { 9 return $"{id[..3]}*{id[^6..]}"; 10 } 11 return id; 12 } 13 14 // after update of codex-dht, shortID should be consistent! 15 public static string ToNodeIdShortId(string id) 16 { 17 if (id.Length > 10) 18 { 19 return $"{id[..2]}*{id[^6..]}"; 20 } 21 return id; 22 } 23 } 24 }