Rocky_Mountain_Vending/.pnpm-store/v10/files/79/9281c867d9d4939dcae5fc6fc61de82c2571cf7334ab5a5d6d01f8ec8bd639dbb4257385a602b0353f2ee2264c1e21a052abd19419a298c8aba25d382f3b4a
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

42 lines
1.2 KiB
Text

'use strict';
var utilBufferFrom = require('@smithy/util-buffer-from');
var utilUtf8 = require('@smithy/util-utf8');
var buffer = require('buffer');
var crypto = require('crypto');
class Hash {
algorithmIdentifier;
secret;
hash;
constructor(algorithmIdentifier, secret) {
this.algorithmIdentifier = algorithmIdentifier;
this.secret = secret;
this.reset();
}
update(toHash, encoding) {
this.hash.update(utilUtf8.toUint8Array(castSourceData(toHash, encoding)));
}
digest() {
return Promise.resolve(this.hash.digest());
}
reset() {
this.hash = this.secret
? crypto.createHmac(this.algorithmIdentifier, castSourceData(this.secret))
: crypto.createHash(this.algorithmIdentifier);
}
}
function castSourceData(toCast, encoding) {
if (buffer.Buffer.isBuffer(toCast)) {
return toCast;
}
if (typeof toCast === "string") {
return utilBufferFrom.fromString(toCast, encoding);
}
if (ArrayBuffer.isView(toCast)) {
return utilBufferFrom.fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength);
}
return utilBufferFrom.fromArrayBuffer(toCast);
}
exports.Hash = Hash;