IM/backend/IM_API/Tools/StreamKeyBuilder.cs

18 lines
448 B
C#

namespace IM_API.Tools
{
public static class StreamKeyBuilder
{
public static string Private(long a, long b)
{
if (a <= 0 || b <= 0) throw new ArgumentException();
return $"p:{(a < b ? $"{a}_{b}" : $"{b}_{a}")}";
}
public static string Group(long groupId)
{
if (groupId <= 0) throw new ArgumentException();
return $"g:{groupId}";
}
}
}