mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-01-02 13:33:07 +00:00
25 lines
553 B
C#
25 lines
553 B
C#
namespace CodexClient
|
|
{
|
|
public static class CodexUtils
|
|
{
|
|
public static string ToShortId(string id)
|
|
{
|
|
if (id.Length > 10)
|
|
{
|
|
return $"{id[..3]}*{id[^6..]}";
|
|
}
|
|
return id;
|
|
}
|
|
|
|
// 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;
|
|
}
|
|
}
|
|
}
|