Introduction: OTP generally refers to one-time passwords. One Time Password (OTP), also known as "one-time password", refers to a password that can only be used once. The one-time password is based on a special algorithm that generates an unpredictable combination of random numbers every 60 seconds, and the iKEY one-time password has been widely used in finance, telecommunications, online games and other fields, effectively protecting the security of users.
Common applications include: Google authenticator, QQ token, etc.
Let's take a look at the renderings first, as shown below:
First, create an otp-one-time-password-demo project using angular-cli with the following command:
Install the OTP plugin, which is the plugin for the encryption algorithm, and the code is as follows:
The progress bar was written by me with reference to ng-simple-progress-bar, because his plugin cannot set the progress manually.
progress-bar.component.html
progress-bar.component.scss
progress-bar.component.ts
The following is mainly our main interface and the code to generate dynamic passwords.
app.component.html
app.component.scss
app.component.ts
Finally, attach the source code download address:
Tourists, if you want to see the hidden content of this post, please Reply
|