cs-codex-dist-tests/ProjectPlugins/CodexPlugin/CodexUtils.cs

25 lines
553 B
C#
Raw Normal View History

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;
}
// 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
}
}