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

            return(wire);
        }
Exemple #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);
        }
Exemple #3
0
 public static Sha1 Convert(this Sha1Wire wire)
 {
     if (wire == null)
     {
         return(default);
Exemple #4
0
 public static Sha1?Convert(this Sha1Wire wire)
 {
     if (wire == null || !wire.Set)
     {
         return(default);