2024-07-26 07:14:46 +00:00
|
|
|
|
namespace CodexPlugin
|
|
|
|
|
{
|
|
|
|
|
public static class CodexUtils
|
|
|
|
|
{
|
|
|
|
|
public static string ToShortId(string id)
|
|
|
|
|
{
|
|
|
|
|
if (id.Length > 10)
|
|
|
|
|
{
|
|
|
|
|
return $"{id[..3]}*{id[^6..]}";
|
|
|
|
|
}
|
|
|
|
|
return id;
|
|
|
|
|
}
|
2024-08-13 11:48:54 +00:00
|
|
|
|
|
|
|
|
|
// after update of codex-dht, shortID should be consistent!
|
|
|
|
|
public static string ToNodeIdShortId(string id)
|
|
|
|
|
{
|
|
|
|
|
if (id.Length > 10)
|
|
|
|
|
{
|
|
|
|
|
return $"{id[..2]}*{id[^6..]}";
|
|
|
|
|
}
|
|
|
|
|
return id;
|
|
|
|
|
}
|
2024-07-26 07:14:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|