Create CRC16.java (#3733)

* Create CRC16.java

* Create CRC16Test.java
This commit is contained in:
rnzit
2022-11-09 11:50:54 +07:00
committed by GitHub
parent eb375a6015
commit b8d6b1a9b0
2 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,23 @@
package com.thealgorithms.others;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
class CRC16Test {
CRC16 crc = new CRC16();
@Test
void testCRC16() {
// given
String textToCRC16 = "hacktoberfest!";
// when
String resultCRC16 = crc.crc16(textToCRC16); // Algorithm CRC16-CCITT-FALSE
// then
assertEquals("10FC", resultCRC16);
}
}