public void ToByteArray_AlternativeValues() { Guid uuid = new Guid("b70df6ac-3b21-4b39-a514-613561f51e2a"); byte[] serialized = UuidUtil.ToByteArray(uuid); CollectionAssert.AreEqual(Hex.FromStringCondensed("b70df6ac3b214b39a514613561f51e2a"), serialized); }
public void ToByteArray() { Guid uuid = new Guid("67dfd496-ea02-4720-b13d-83a462168b1d"); byte[] serialized = UuidUtil.ToByteArray(uuid); CollectionAssert.AreEqual(Hex.FromStringCondensed("67dfd496ea024720b13d83a462168b1d"), serialized); }
public static AddressProto ToProtobuf(SignalServiceAddress signalServiceAddress) { AddressProto builder = new AddressProto(); if (signalServiceAddress.GetNumber() != null) { builder.E164 = signalServiceAddress.E164; } if (signalServiceAddress.Uuid.HasValue) { builder.Uuid = ByteString.CopyFrom(UuidUtil.ToByteArray(signalServiceAddress.Uuid.Value)); } if (signalServiceAddress.Relay != null) { builder.Relay = signalServiceAddress.Relay; } return(builder); }