C# Class Secp256k1.VarStringExtensions

Mostrar archivo Open project: TangibleCryptography/Secp256k1

Public Methods

Method Description
GetVarString ( this str ) : byte[]

Extension Method for string type Returns a byte array with string length as a VarInt followed by string contents Is a Bitcoin Protocol specific structure https://en.bitcoin.it/wiki/Protocol_specification#Variable_length_string Limitation: The Bitcoin protocol supports string up to 2^64 -1 (unit64) bytes in length. The C# built in type "string" only supports strings up to 2^31-1 (singed int32) bytes in length. To strictly comply with Bitcoin spec would require a new class capable of longer strings. Although as a practical matter no existing messages support string lengths beyond the Int32 limit.

Method Details

GetVarString() public static method

Extension Method for string type Returns a byte array with string length as a VarInt followed by string contents Is a Bitcoin Protocol specific structure https://en.bitcoin.it/wiki/Protocol_specification#Variable_length_string Limitation: The Bitcoin protocol supports string up to 2^64 -1 (unit64) bytes in length. The C# built in type "string" only supports strings up to 2^31-1 (singed int32) bytes in length. To strictly comply with Bitcoin spec would require a new class capable of longer strings. Although as a practical matter no existing messages support string lengths beyond the Int32 limit.
public static GetVarString ( this str ) : byte[]
str this Instance of the string class being extended.
return byte[]