verify-brand.mjs 563 B

12345678910111213
  1. import { createHash } from 'node:crypto'
  2. import { readFile } from 'node:fs/promises'
  3. import { fileURLToPath } from 'node:url'
  4. const expected = 'e19c03450c62238aeb70ad735f612d4bfc61964e1473b1be4bdca1d9230bd086'
  5. const source = fileURLToPath(new URL('../public/brand/AppIcon-1024.png', import.meta.url))
  6. const digest = createHash('sha256').update(await readFile(source)).digest('hex')
  7. if (digest !== expected) {
  8. throw new Error(`Brand source hash mismatch: expected ${expected}, received ${digest}`)
  9. }
  10. process.stdout.write(`Brand source verified: ${digest}\n`)