Пример #1
0
        public static Sha1Wire Convert(this Sha1 model)
        {
            var wire = new Sha1Wire
            {
                Blit0 = model.Blit0,
                Blit1 = model.Blit1,
                Blit2 = model.Blit2
            };

            return(wire);
        }
Пример #2
0
        public static Sha1Wire Convert(this Sha1 model)
        {
            Sha1Wire wire;

            var array = ArrayPool <byte> .Shared.Rent(Sha1.ByteLen);

            {
                model.CopyTo(array);

                wire = new Sha1Wire
                {
                    Set  = true,
                    Data = Google.Protobuf.ByteString.CopyFrom(array, 0, Sha1.ByteLen)
                };
            }
            ArrayPool <byte> .Shared.Return(array);

            return(wire);
        }
Пример #3
0
 public static Sha1 Convert(this Sha1Wire wire)
 {
     if (wire == null)
     {
         return(default);
Пример #4
0
 public static Sha1?Convert(this Sha1Wire wire)
 {
     if (wire == null || !wire.Set)
     {
         return(default);