D
D
DD-var2020-02-07 22:59:05
C++ / C#
DD-var, 2020-02-07 22:59:05

How to calculate CRC?

there are bytes. I can't find how to fold them correctly, please tell me

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Yudakov, 2020-02-08
@AlexanderYudakov

The easiest option:

public static byte Crc(byte[] data)
{
    var result = (byte)0;
    foreach (var b in data)
        result = result ^ b;

    return result;
}

D
DD-var, 2020-02-08
@DD-var

for byte arrays, the response is 14
00, 03, 01, 00, 00, 0x0C

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question