Rocky_Mountain_Vending/.pnpm-store/v10/files/7f/a7a2a3d7874f7e2e31de30d1908441f2c990a967eb9e14d38468fd22d04c42131dfeea4822e8bfeb2eccfd0a9a72d27e56c86226bc73e04f7e081fd538eb56
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

29 lines
799 B
Text

import { Sha1 as WebCryptoSha1 } from "./webCryptoSha1";
import { Checksum, SourceData } from "@aws-sdk/types";
import { supportsWebCrypto } from "@aws-crypto/supports-web-crypto";
import { locateWindow } from "@aws-sdk/util-locate-window";
import { convertToBuffer } from "@aws-crypto/util";
export class Sha1 implements Checksum {
private hash: Checksum;
constructor(secret?: SourceData) {
if (supportsWebCrypto(locateWindow())) {
this.hash = new WebCryptoSha1(secret);
} else {
throw new Error("SHA1 not supported");
}
}
update(data: SourceData, encoding?: "utf8" | "ascii" | "latin1"): void {
this.hash.update(convertToBuffer(data));
}
digest(): Promise<Uint8Array> {
return this.hash.digest();
}
reset(): void {
this.hash.reset();
}
}