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>
21 lines
517 B
Text
21 lines
517 B
Text
import { AwsCrc32 } from "@aws-crypto/crc32";
|
|
import { numToUint8 } from "@aws-crypto/util";
|
|
import * as zlib from "zlib";
|
|
class NodeCrc32 {
|
|
checksum = 0;
|
|
update(data) {
|
|
this.checksum = zlib.crc32(data, this.checksum);
|
|
}
|
|
async digest() {
|
|
return numToUint8(this.checksum);
|
|
}
|
|
reset() {
|
|
this.checksum = 0;
|
|
}
|
|
}
|
|
export const getCrc32ChecksumAlgorithmFunction = () => {
|
|
if (typeof zlib.crc32 === "undefined") {
|
|
return AwsCrc32;
|
|
}
|
|
return NodeCrc32;
|
|
};
|