File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1-
21using NBitcoin . DataEncoders ;
32using System ;
3+ #if HAS_SPAN
44using System . Buffers . Binary ;
5+ #endif
56using System . Linq ;
67using System . Runtime . InteropServices ;
78
@@ -162,6 +163,10 @@ public override string ToString()
162163 }
163164
164165#if HAS_SPAN
166+
167+ /// <summary>
168+ /// Returns HEX string representation.
169+ /// </summary>
165170 /// <remarks>The method allocates a new 64 char array.</remarks>
166171 public Span < char > ToSpanString ( )
167172 {
@@ -171,6 +176,9 @@ public Span<char> ToSpanString()
171176 return result ;
172177 }
173178
179+ /// <summary>
180+ /// Returns HEX string representation.
181+ /// </summary>
174182 /// <remarks>The method does not allocate.</remarks>
175183 public void ToSpanString ( Span < char > destination )
176184 {
@@ -193,6 +201,7 @@ public void ToSpanString(Span<char> destination)
193201
194202 Span < byte > bytes = MemoryMarshal . Cast < ulong , byte > ( ulongs ) ;
195203
204+ // Reverses order of bytes of pn0, pn1, pn2, and pn3 are set in a little endian manner.
196205 for ( int i = 31 , j = 0 ; i >= 0 ; i -- , j += 2 )
197206 {
198207 HexEncoder . ToCharsBuffer ( bytes [ i ] , destination , startingIndex : j ) ;
You can’t perform that action at this time.
0 commit comments