* Create a unique checksum hashing the fingerprint and a few other values. * @param {string} serializedIds * @param {number=} opt_offsetMin * @return {string}
(serializedIds, opt_offsetMin)
| 110 | * @return {string} |
| 111 | */ |
| 112 | function getCheckSum(serializedIds, opt_offsetMin) { |
| 113 | const fingerprint = getFingerprint(); |
| 114 | const offset = opt_offsetMin || 0; |
| 115 | const timestamp = getMinSinceEpoch() - offset; |
| 116 | const crc = crc32([fingerprint, timestamp, serializedIds].join(DELIMITER)); |
| 117 | // Encoded to base36 for less bytes. |
| 118 | return crc.toString(36); |
| 119 | } |
| 120 | |
| 121 | /** |
| 122 | * Generates a semi-unique value for page visitor. |
no test coverage detected