(msg: string, meaning: string = '')
| 222 | } |
| 223 | |
| 224 | export function computeMsgId(msg: string, meaning: string = ''): string { |
| 225 | let msgFingerprint = fingerprint(msg); |
| 226 | |
| 227 | if (meaning) { |
| 228 | // Rotate the 64-bit message fingerprint one bit to the left and then add the meaning |
| 229 | // fingerprint. |
| 230 | msgFingerprint = |
| 231 | BigInt.asUintN(64, msgFingerprint << BigInt(1)) | |
| 232 | ((msgFingerprint >> BigInt(63)) & BigInt(1)); |
| 233 | msgFingerprint += fingerprint(meaning); |
| 234 | } |
| 235 | |
| 236 | return BigInt.asUintN(63, msgFingerprint).toString(); |
| 237 | } |
| 238 | |
| 239 | function hash32(view: DataView, length: number, c: number): number { |
| 240 | let a = 0x9e3779b9, |
no test coverage detected
searching dependent graphs…