// src/safe_equal.ts
import { timingSafeEqual, createHmac, randomBytes } from "crypto";
var hmacKey = randomBytes(32);
function safeEqual(a, b) {
  const bufferA = typeof a === "string" ? Buffer.from(a, "utf8") : Buffer.from(a);
  const bufferB = typeof b === "string" ? Buffer.from(b, "utf8") : Buffer.from(b);
  const hmacA = createHmac("sha256", hmacKey).update(bufferA).digest();
  const hmacB = createHmac("sha256", hmacKey).update(bufferB).digest();
  return timingSafeEqual(hmacA, hmacB);
}

export {
  safeEqual
};
/*
 * @boringnode/encryption
 *
 * @license MIT
 * @copyright Boring Node
 */
//# sourceMappingURL=chunk-RQR5RUKG.js.map