mirror of
https://github.com/SabreTools/SabreTools.ASN1.git
synced 2026-02-18 14:07:41 +00:00
24 lines
808 B
C#
24 lines
808 B
C#
using System.Linq;
|
|
|
|
namespace SabreTools.ASN1
|
|
{
|
|
/// <summary>
|
|
/// Methods related to Object Identifiers (OID) and dot notation
|
|
/// </summary>
|
|
public static partial class ObjectIdentifier
|
|
{
|
|
/// <summary>
|
|
/// Parse an OID in separated-value notation into dot notation
|
|
/// </summary>
|
|
/// <param name="values">List of values to check against</param>
|
|
/// <returns>List of values representing the dot notation</returns>
|
|
public static string? ParseOIDToDotNotation(ulong[]? values)
|
|
{
|
|
// If we have an invalid set of values, we can't do anything
|
|
if (values == null || values.Length == 0)
|
|
return null;
|
|
|
|
return string.Join(".", values.Select(v => v.ToString()).ToArray());
|
|
}
|
|
}
|
|
} |