* Check if the checksum is valid with time offset tolerance. * @param {string} serializedIds * @param {string} checksum * @return {boolean}
(serializedIds, checksum)
| 94 | * @return {boolean} |
| 95 | */ |
| 96 | function isCheckSumValid(serializedIds, checksum) { |
| 97 | for (let i = 0; i <= CHECKSUM_OFFSET_MAX_MIN; i++) { |
| 98 | const calculateCheckSum = getCheckSum(serializedIds, i); |
| 99 | if (calculateCheckSum == checksum) { |
| 100 | return true; |
| 101 | } |
| 102 | } |
| 103 | return false; |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * Create a unique checksum hashing the fingerprint and a few other values. |
no test coverage detected