SerializationHelper

Summary

Members
Descriptions

Is a big Number negative.

Negate a big number.

Convert an unsigned decimal number as string to a big number.

Convert an signed decimal number as string to a big number.

Convert big number to an unsigned decimal number.

Convert big number to an signed decimal number.

Convert base64 with fc prefix to byte array.

Convert ascii char to symbol value.

Convert snake case string to pascal case.

Convert pascal case string to snake case.

Serialize object to byte array.

Encode byte array to hexadecimal string.

Decode hexadecimal string to byte array.

Serialize object to hexadecimal encoded string.

Combina multiple arrays into one.

Convert DateTime to time_point (miliseconds since epoch)

Convert time_point (miliseconds since epoch) to DateTime.

Convert DateTime to time_point_sec (seconds since epoch)

Convert time_point_sec (seconds since epoch) to DateTime.

Convert DateTime to block_timestamp_type (half-seconds since a different epoch)

Convert block_timestamp_type (half-seconds since a different epoch) to DateTime.

Convert Name into unsigned long.

Convert Name into bytes.

It takes a string of hexadecimal digits and reverses the order of the bytes.

Convert uint64_t into EOSIO name.

Members

public static bool IsNegative(byte[] bin)

Is a big Number negative.

Parameters

  • bin big number in byte array

Returns

public static void Negate(byte[] bin)

Negate a big number.

Parameters

  • bin big number in byte array

public static byte[] DecimalToBinary(uint size, string s)

Convert an unsigned decimal number as string to a big number.

Parameters

  • size Size in bytes of the big number

  • s decimal encoded as string

Returns

public static byte[] SignedDecimalToBinary(uint size, string s)

Convert an signed decimal number as string to a big number.

Parameters

  • size Size in bytes of the big number

  • s decimal encoded as string

Returns

public static string BinaryToDecimal(byte[] bin, int minDigits)

Convert big number to an unsigned decimal number.

Parameters

  • bin big number as byte array

  • minDigits 0-pad result to this many digits

Returns

public static string SignedBinaryToDecimal(byte[] bin, int minDigits)

Convert big number to an signed decimal number.

Parameters

  • bin big number as byte array

  • minDigits 0-pad result to this many digits

Returns

public static byte[] Base64FcStringToByteArray(string s)

Convert base64 with fc prefix to byte array.

Parameters

  • s string 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

  • s string to convert

Returns

public static string PascalCaseToSnakeCase(string s)

Convert pascal case string to snake case.

Parameters

  • s string to convert

Returns

public static byte[] ObjectToByteArray(object obj)

Serialize object to byte array.

Parameters

  • obj object to serialize

Returns

public static string ByteArrayToHexString(byte[] ba)

Encode byte array to hexadecimal string.

Parameters

  • ba byte 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

  • value date to convert

Returns

public static DateTime TimePointToDate(long ticks)

Convert time_point (miliseconds since epoch) to DateTime.

Parameters

  • ticks time_point ticks to convert

Returns

public static UInt32 DateToTimePointSec(DateTime value)

Convert DateTime to time_point_sec (seconds since epoch)

Parameters

  • value date to convert

Returns

public static DateTime TimePointSecToDate(UInt32 secs)

Convert time_point_sec (seconds since epoch) to DateTime.

Parameters

  • secs time_point_sec to convert

Returns

public static UInt32 DateToBlockTimestamp(DateTime value)

Convert DateTime to block_timestamp_type (half-seconds since a different epoch)

Parameters

  • value date to convert

Returns

public static DateTime BlockTimestampToDate(UInt32 slot)

Convert block_timestamp_type (half-seconds since a different epoch) to DateTime.

Parameters

  • slot block_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

  • h The 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