generateCvvFromKey
generateCvvFromKey(
pan: string,
expiry: string,
derivedKey: Buffer,
keyId: string,
): stringSource: cvv.ts:120
Generates a 4-digit CVV using a pre-derived HMAC key.
Prefer this overload for repeated calls — derive the key once with deriveHmacKey() and reuse the Buffer (e.g. inside EarnmoreClient).
Parameters
pan(string) — 16-digit PAN stringexpiry(string) — "MM/YY" formatted expiry stringderivedKey(Buffer) — 32-byte key from deriveHmacKey()keyId(string) — Key identifier (NIST SP 800-57 / ISO 11568-1). Must match the keyId used during validation. Default: DEFAULT_KEY_ID ("default")
Returns
string