latest
eser/stackThis package works with Node.js, Deno, BunIt is unknown whether this package works with Cloudflare Workers, Browsers
JSR Score
41%
Published
3 months ago (0.7.20)
// Copyright 2023-present Eser Ozvataf and other contributors. All rights reserved. Apache-2.0 license. import * as hex from "jsr:/@std/encoding@^1.0.1/hex"; import * as jsRuntime from "jsr:/@eser/standards@^0.7.20/js-runtime"; const env = jsRuntime.current.getEnv(); const deploymentId = env["DENO_DEPLOYMENT_ID"] || // For CI env["GITHUB_SHA"] || crypto.randomUUID(); const buildIdHash = await crypto.subtle.digest( "SHA-1", new TextEncoder().encode(deploymentId), ); export let BUILD_ID = hex.encodeHex(buildIdHash); export const setBuildId = (buildId: string) => { BUILD_ID = buildId; };