// Helper routine to convert the sequence number to a string representation. public static string SequenceNumberToString(SequenceNumber sqn) { byte[] bytes = sqn.GetBytes(); long realLsnHigh = BitConverter.ToInt64(bytes, 0); if (bytes.Length == 8) { return(realLsnHigh.ToString()); } else { long realLsnLow = BitConverter.ToInt64(bytes, 8); return(realLsnLow.ToString() + "-" + realLsnHigh.ToString()); } }
// Helper routine to convert the sequence number to a string representation. public static string SequenceNumberToString(SequenceNumber sqn) { byte[] bytes = sqn.GetBytes(); long realLsnHigh = BitConverter.ToInt64(bytes, 0); if (bytes.Length == 8) { return realLsnHigh.ToString(); } else { long realLsnLow = BitConverter.ToInt64(bytes, 8); return realLsnLow.ToString() + "-" + realLsnHigh.ToString(); } }
public static string Identifier(this SequenceNumber sequence) => sequence == SequenceNumber.Invalid ? "INVALID" : string.Concat(sequence.GetBytes().Select(_ => _.ToString("X")));