public static ulong FromString(string idString) { var idBytes = Safe64EncodingExtension.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 = Safe64EncodingExtension.EncodeBytes(idBytes); return(idString); }