MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / sha256Hash

Function sha256Hash

sdk/js/src/get-compose-hash.browser.ts:35–39  ·  view source on GitHub ↗

* Browser-compatible SHA-256 hash using crypto-browserify * @param data - Data to hash * @returns Promise resolving to hex-encoded hash

(data: string)

Source from the content-addressed store, hash-verified

33 * @returns Promise resolving to hex-encoded hash
34 */
35async function sha256Hash(data: string): Promise<string> {
36 const hash = crypto.createHash('sha256');
37 hash.update(data, 'utf8');
38 return hash.digest('hex');
39}
40
41/**
42 * Get the hash of a docker-compose configuration

Callers 1

getComposeHashFunction · 0.85

Calls 1

digestMethod · 0.45

Tested by

no test coverage detected