Compare Byte arrays - CSharp System

CSharp examples for System:Byte Array

Description

Compare Byte arrays

Demo Code


using System.Security.Cryptography;
using System.IO;/*from   ww  w  .j  a  v  a 2  s .  c  o  m*/
using System.Text;
using System.Collections.Generic;
using System;

public class Main{
        private static bool CompareBytearrays(byte[] a, byte[] b)
        {
            if (a.Length != b.Length)
                return false;
            int i = 0;
            foreach (byte c in a)
            {
                if (c != b[i])
                    return false;
                i++;
            }
            return true;
        }
}

Related Tutorials