Skip to content

Commit 35fe7fc

Browse files
committed
Added Asn1Utils.GetLengthBytesAsMemory which is identical to Asn1Utils.GetLengthBytes.
1 parent bbc6575 commit 35fe7fc

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Asn1Parser/Asn1Utils.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ public static Byte[] GetLengthBytes(Int32 payloadLength) {
4848
return retValue;
4949
}
5050
/// <summary>
51+
/// Generates tag length header for specified size.
52+
/// </summary>
53+
/// <param name="payloadLength">A projected tag length.</param>
54+
/// <returns>Encoded tag length header. Return value do not contain tag and payload.</returns>
55+
public static ReadOnlyMemory<Byte> GetLengthBytesAsMemory(Int32 payloadLength) {
56+
return GetLengthBytes(payloadLength);
57+
}
58+
/// <summary>
5159
/// Calculates the ASN.1 payload length from a given ASN.1 length header.
5260
/// </summary>
5361
/// <param name="asnHeader">A byte array that represents ASN.1 length header</param>

0 commit comments

Comments
 (0)