Пример #1
0
        // Concatenate two Bytes
        public Bytes Concat(Bytes other)
        {
            int length = this.Length() + other.Length();

            sbyte[] newBytes = new sbyte[length];
            Array.Copy(bytes, 0, newBytes, 0, this.Length());
            Array.Copy(other.bytes, 0, newBytes, this.Length(), other.Length());
            return(new Bytes(newBytes));
        }
Пример #2
0
        public static string BytesToHex(Bytes bytes)
        {
            string res = "";

            for (int i = 0; i < bytes.Length(); i++)
            {
                res += ByteToHex(bytes[i]);
            }
            return(res);
        }
Пример #3
0
        // NOT TRANSLATED TO PRAVDA VM
        public bool Equals(Bytes other)
        {
            if (other == null)
            {
                return(false);
            }

            if (this.Length() != other.Length())
            {
                return(false);
            }

            for (int i = 0; i < this.Length(); i++)
            {
                if (this[i] != other[i])
                {
                    return(false);
                }
            }

            return(true);
        }