(a: string, b: string)
| 32 | * ("ts","code") vs ("tsc","ode") so no separator is needed under Bun. |
| 33 | */ |
| 34 | export function hashPair(a: string, b: string): string { |
| 35 | if (typeof Bun !== 'undefined') { |
| 36 | return Bun.hash(b, Bun.hash(a)).toString() |
| 37 | } |
| 38 | // eslint-disable-next-line @typescript-eslint/no-require-imports |
| 39 | const crypto = require('crypto') as typeof import('crypto') |
| 40 | return crypto |
| 41 | .createHash('sha256') |
| 42 | .update(a) |
| 43 | .update('\0') |
| 44 | .update(b) |
| 45 | .digest('hex') |
| 46 | } |
| 47 |
no test coverage detected