Skip to content

Hex Utility

AlexLEWIS edited this page May 11, 2021 · 3 revisions

The Hex Utility of Cosmos.Standard is located under the namespace Cosmos.Conversions, and it provides two methods:

  • Convert hexadecimal value to byte[]
  • Convert byte[] to hexadecimal value

Usage:

var dec = "1234567890";
var hex = ScaleConv.X2X(dec, 10, 16); // Should be 499602D2

var bytes = Hex.ToBytes(hex);

Console.Writeline(Hex.ToString(bytes)); 
// => 499602D2

Suggestion You can use it in conjunction with ScaleConv.


Clone this wiki locally