Class CRC16
java.lang.Object
io.getlime.security.powerauth.crypto.lib.util.CRC16
- All Implemented Interfaces:
Checksum
Class which computes CRC-16 of input data providing standard
Checksum interface.
The algorithm uses irreducible polynomial 1 + x^2 + x^15 + x^16.
- Author:
- Roman Strobl, roman.strobl@wultra.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetValue()Return the current CRC-16 value.voidreset()Reset CRC-16 to initial value.voidupdate(byte[] bytes, int offset, int length) Update the CRC-16 checksum with specified array of bytes.voidupdate(int b) Update the CRC-16 checksum with the specified byte (the low eight bits of the argument b).
-
Constructor Details
-
CRC16
public CRC16()Default constructor.
-
-
Method Details
-
update
public void update(int b) Update the CRC-16 checksum with the specified byte (the low eight bits of the argument b). -
update
public void update(byte[] bytes, int offset, int length) Update the CRC-16 checksum with specified array of bytes. -
getValue
public long getValue()Return the current CRC-16 value. -
reset
public void reset()Reset CRC-16 to initial value.
-