rmhaiderali/nadra-digital-id — reverse-engineered prompt
Reverse engineered prompt
Build me a TypeScript JavaScript library for working with NADRA Digital ID QR and Verifiable Credential data.
I want it to let developers decode a QR payload, check a PIN by hashing it, try the nearby time values needed for decryption, decrypt the credential data, verify the RSA signature, and clean up Urdu or right to left text so it compares correctly. It should also support the reverse flow for testing, encoding data back into a QR friendly string, encrypting fields with a PIN and time, and signing a credential with a test key.
Please make the API simple, with functions like encode, decode, encrypt, decrypt, sign, verify, sha256, timeRange, and normalizeText. Return clear error objects instead of throwing wherever possible. Include a small README style usage example showing the normal verification flow from QR string plus PIN to verified credential.
Use current docs online if you need to.
Want more depth? Deep Reverse