MCPcopy Create free account
hub / github.com/reactnativecn/react-native-update / calculateContentHash

Function calculateContentHash

scripts/bundle-metadata-plugin.js:7–11  ·  view source on GitHub ↗
(bundleCode)

Source from the content-addressed store, hash-verified

5console.log(`[Bundle Metadata] Project root: ${PROJECT_ROOT}`);
6
7function calculateContentHash(bundleCode) {
8 const hash = crypto.createHash('sha256');
9 hash.update(bundleCode, 'utf8');
10 return hash.digest('hex');
11}
12
13function generateMetadataInjection(contentHash) {
14 return `// Auto-injected bundle metadata by Metro plugin

Callers 1

metadataSerializerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected