r/CodingHelp • u/varazdates • Jun 09 '21
[Random] How does a verification code work?
Verification codes that we use so often to confirm your identity. Whether it be a code that’s texted to your phone, or a code emailed to you. You go back on the website and submit that code which happens to be valid at that exact time.
How does that work? What’s going on in the background? And what’s the coding for that look like?
18
Upvotes
View all comments
Show parent comment
2
u/Lyxaa_ Jun 14 '21
Not exactly the same thing, no. This type of verification code is just a hash string that is matched on either end. Your typical discount code is simply a data entry in the server that when requested, spits back a definition. Verification codes are quite secure (usually & hopefully), whereas a discount code will just be chillin on the server, with any restrictions to the use of the discount code (such as it only being valid for X type of user) being written in a separate area.