Skip to content

fix(payments): generate quote and payment identifiers with crypto.randomUUID (#290) - #303

Merged
David-patrick-chuks-02 merged 2 commits into
Lilly-Protocol:mainfrom
ghzhost:fix/uuid-id-generation-290
Sep 6, 2026
Merged

fix(payments): generate quote and payment identifiers with crypto.randomUUID (#290)#303
David-patrick-chuks-02 merged 2 commits into
Lilly-Protocol:mainfrom
ghzhost:fix/uuid-id-generation-290

Conversation

@ghzhost

@ghzhost ghzhost commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #290

Summary of Changes

  • Replaced timestamp + Math.random generation in generateQuoteId and generatePaymentId with CSPRNG crypto.randomUUID().
  • Maintained the readable quote_ and pay_ prefixes (e.g. quote_${crypto.randomUUID()} and pay_${crypto.randomUUID()}).
  • Added unit tests in tests/payments-id-generation.test.ts verifying collision-resistance across rapid sequential creations and adherence to expected prefix/UUID format.

@David-patrick-chuks-02
David-patrick-chuks-02 merged commit 7dfa044 into Lilly-Protocol:main Sep 6, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bounty: $55] Generate quote and payment identifiers with crypto.randomUUID

3 participants