khalidahmedshalabi / GenerateValidateScratchCards

A demo of a scratch cards generator & validator

Home Page:https://khalidahmedshalabi.github.io/GenerateValidateScratchCards/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generate & Validate Scratch Cards

A demo of a scratch cards generator & validator.

Use

  • Generate scratch cards. Each card can hold a specific value, that can be recharge amount for example, if we're at a company that generates recharge cards for its customers.
  • Validate scratch cards. Validate the cards you generated and check if a card has expired.

Briefly, how it works

  • Card numbers are stored in hash tables for better performance with a key of the current timestamp when a card is generated. Key and card amount are mixed, then shuffled and finally encrypted using Format-perserving Encryption. At the end, Luhn algorithm is applied to the final card number and it's delivered to the customer.
  • Different algorithms and different keys are used based on current date and time which enables us to check expiration.
  • For validation, we do the same processes, but in reverse.

About

A demo of a scratch cards generator & validator

https://khalidahmedshalabi.github.io/GenerateValidateScratchCards/


Languages

Language:JavaScript 58.8%Language:CSS 27.4%Language:HTML 13.7%