File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ public static ReadOnlyMemory<Byte> GetLengthBytesAsMemory(Int32 payloadLength) {
5858 /// <summary>
5959 /// Calculates the ASN.1 payload length from a given ASN.1 length header.
6060 /// </summary>
61- /// <param name="asnHeader">A byte array that represents ASN.1 length header</param>
61+ /// <param name="asnHeader">A byte array that represents ASN.1 length header excluding tag and payload. </param>
6262 /// <exception cref="OverflowException">
6363 /// <strong>asnHeader</strong> parameter length is more than 4 bytes or is invalid value.
6464 /// </exception>
@@ -67,7 +67,7 @@ public static Int64 CalculatePayloadLength(ReadOnlySpan<Byte> asnHeader) {
6767 if ( asnHeader . Length == 0 ) {
6868 return 0 ;
6969 }
70- if ( asnHeader [ 0 ] < 127 ) {
70+ if ( asnHeader [ 0 ] <= 127 ) {
7171 return asnHeader [ 0 ] ;
7272 }
7373 Int32 lengthBytes = asnHeader [ 0 ] - 128 ;
You can’t perform that action at this time.
0 commit comments