Skip to main content
This package works with Node.js, Deno, BunIt is unknown whether this package works with Cloudflare Workers, Browsers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
It is unknown whether this package works with Browsers
JSR Score
41%
Published
3 months ago (0.7.20)
Package root>build-id.ts
// 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; };