SerializationHelper
Summary
public static bool IsNegative(byte[] bin)
Is a big Number negative.
public static void Negate(byte[] bin)
Negate a big number.
public static byte[] DecimalToBinary(uint size, string s)
Convert an unsigned decimal number as string to a big number.
public static byte[] SignedDecimalToBinary(uint size, string s)
Convert an signed decimal number as string to a big number.
public static string BinaryToDecimal(byte[] bin, int minDigits)
Convert big number to an unsigned decimal number.
public static string SignedBinaryToDecimal(byte[] bin, int minDigits)
Convert big number to an signed decimal number.
public static byte[] Base64FcStringToByteArray(string s)
Convert base64 with fc prefix to byte array.
public static byte CharToSymbol(char c)
Convert ascii char to symbol value.
public static string SnakeCaseToPascalCase(string s)
Convert snake case string to pascal case.
public static string PascalCaseToSnakeCase(string s)
Convert pascal case string to snake case.
public static byte[] ObjectToByteArray(object obj)
Serialize object to byte array.
public static string ByteArrayToHexString(byte[] ba)
Encode byte array to hexadecimal string.
public static byte[] HexStringToByteArray(string hex)
Decode hexadecimal string to byte array.
public static string ObjectToHexString(object obj)
Serialize object to hexadecimal encoded string.
public static byte[] Combine(IEnumerable< byte[]> arrays)
Combina multiple arrays into one.
public static UInt64 DateToTimePoint(DateTime value)
Convert DateTime to time_point (miliseconds since epoch)
public static DateTime TimePointToDate(long ticks)
Convert time_point (miliseconds since epoch) to DateTime.
public static UInt32 DateToTimePointSec(DateTime value)
Convert DateTime to time_point_sec (seconds since epoch)
public static DateTime TimePointSecToDate(UInt32 secs)
Convert time_point_sec (seconds since epoch) to DateTime.
public static UInt32 DateToBlockTimestamp(DateTime value)
Convert DateTime to block_timestamp_type (half-seconds since a different epoch)
public static DateTime BlockTimestampToDate(UInt32 slot)
Convert block_timestamp_type (half-seconds since a different epoch) to DateTime.
public static UInt64 ConvertNameToLong(string name)
Convert Name into unsigned long.
public static byte[] ConvertNameToBytes(string name)
Convert Name into bytes.
public static string ReverseHex(string h)
It takes a string of hexadecimal digits and reverses the order of the bytes.
public static string ConvertULongToName(ulong binary)
Convert uint64_t into EOSIO name.
Members
public static bool IsNegative(byte[] bin)
Is a big Number negative.
Parameters
binbig number in byte array
Returns
public static void Negate(byte[] bin)
Negate a big number.
Parameters
binbig number in byte array
public static byte[] DecimalToBinary(uint size, string s)
Convert an unsigned decimal number as string to a big number.
Parameters
sizeSize in bytes of the big numbersdecimal encoded as string
Returns
public static byte[] SignedDecimalToBinary(uint size, string s)
Convert an signed decimal number as string to a big number.
Parameters
sizeSize in bytes of the big numbersdecimal encoded as string
Returns
public static string BinaryToDecimal(byte[] bin, int minDigits)
Convert big number to an unsigned decimal number.
Parameters
binbig number as byte arrayminDigits0-pad result to this many digits
Returns
public static string SignedBinaryToDecimal(byte[] bin, int minDigits)
Convert big number to an signed decimal number.
Parameters
binbig number as byte arrayminDigits0-pad result to this many digits
Returns
public static byte[] Base64FcStringToByteArray(string s)
Convert base64 with fc prefix to byte array.
Parameters
sstring to convert
Returns
public static byte CharToSymbol(char c)
Convert ascii char to symbol value.
Parameters
c
Returns
public static string SnakeCaseToPascalCase(string s)
Convert snake case string to pascal case.
Parameters
sstring to convert
Returns
public static string PascalCaseToSnakeCase(string s)
Convert pascal case string to snake case.
Parameters
sstring to convert
Returns
public static byte[] ObjectToByteArray(object obj)
Serialize object to byte array.
Parameters
objobject to serialize
Returns
public static string ByteArrayToHexString(byte[] ba)
Encode byte array to hexadecimal string.
Parameters
babyte array to convert
Returns
public static byte[] HexStringToByteArray(string hex)
Decode hexadecimal string to byte array.
Parameters
hex
Returns
public static string ObjectToHexString(object obj)
Serialize object to hexadecimal encoded string.
Parameters
obj
Returns
public static byte[] Combine(IEnumerable< byte[]> arrays)
Combina multiple arrays into one.
Parameters
arrays
Returns
public static UInt64 DateToTimePoint(DateTime value)
Convert DateTime to time_point (miliseconds since epoch)
Parameters
valuedate to convert
Returns
public static DateTime TimePointToDate(long ticks)
Convert time_point (miliseconds since epoch) to DateTime.
Parameters
tickstime_point ticks to convert
Returns
public static UInt32 DateToTimePointSec(DateTime value)
Convert DateTime to time_point_sec (seconds since epoch)
Parameters
valuedate to convert
Returns
public static DateTime TimePointSecToDate(UInt32 secs)
Convert time_point_sec (seconds since epoch) to DateTime.
Parameters
secstime_point_sec to convert
Returns
public static UInt32 DateToBlockTimestamp(DateTime value)
Convert DateTime to block_timestamp_type (half-seconds since a different epoch)
Parameters
valuedate to convert
Returns
public static DateTime BlockTimestampToDate(UInt32 slot)
Convert block_timestamp_type (half-seconds since a different epoch) to DateTime.
Parameters
slotblock_timestamp slot to convert
Returns
public static UInt64 ConvertNameToLong(string name)
Convert Name into unsigned long.
Parameters
name
Returns
Converted value
public static byte[] ConvertNameToBytes(string name)
Convert Name into bytes.
Parameters
name
Returns
Converted value bytes
public static string ReverseHex(string h)
It takes a string of hexadecimal digits and reverses the order of the bytes.
Parameters
hThe hex string to reverse.
Returns
The hex value is being reversed.
public static string ConvertULongToName(ulong binary)
Convert uint64_t into EOSIO name.
Parameters
binary
Returns
EOSIO Name
Last updated