Parsing a hex string that represents a negative value has inconsistent results. The ToByteArray seems to return the correctly expected byte sequence, however, the ToString method returns an incorrect result.
Set Value = BigInteger.Parse("FF", NumberStyles.AllowHexSpecifier)
The ToByteArray correctly returns 0xFF. The ToString method return -65281 (0xFFFF00FF). It should return -1.
Something is getting confused in the parsing or possibly the ToString method.
Parsing a hex string that represents a negative value has inconsistent results. The
ToByteArray
seems to return the correctly expected byte sequence, however, theToString
method returns an incorrect result.The
ToByteArray
correctly returns 0xFF. TheToString
method return -65281 (0xFFFF00FF). It should return -1.Something is getting confused in the parsing or possibly the
ToString
method.