UNPKG

@walletpass/pass-js

Version:

Apple Wallet Pass generating and pushing updates from Node.js

15 lines 834 B
// SPDX-License-Identifier: AGPL-3.0-or-later // Copyright (C) 2017-2026 Konstantin Vyatkin <tino@vtkn.io> import { createHash } from 'node:crypto'; // SHA-1 is used because Apple's PassKit spec requires SHA-1 hex digests // in the `manifest.json` map (one entry per file in the pkpass bundle). // This is NOT a security-sensitive hash — it's a fingerprint the bundle // format demands. The PKCS#7 signature over manifest.json (in sign-manifest.ts) // is what provides integrity/authenticity. // // Do not change this to SHA-256 or stronger without changing the Apple spec. // See: https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/PassKit_PG/Creating.html export function getBufferHash(data) { return createHash('sha1').update(data).digest('hex'); } //# sourceMappingURL=get-buffer-hash.js.map