public static ulong FromString(string idString) { var idBytes = Safe64Encoding.DecodeBytes(idString); if (BitConverter.IsLittleEndian) { Array.Reverse(idBytes); } var id = BitConverter.ToUInt64(idBytes, 0); return(id); }
public static string ToString(ulong id) { var idBytes = BitConverter.GetBytes(id); if (BitConverter.IsLittleEndian) { Array.Reverse(idBytes); } var idString = Safe64Encoding.EncodeBytes(idBytes); return(idString); }