projects
/
squeep-totp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
minor doc typo fix
[squeep-totp]
/
README.md
diff --git
a/README.md
b/README.md
index 98ceeb90026e61d1624ab1a02f95b1aaafff9abf..4fa7379003bbc8932fb54221f1c7a619d26317b3 100644
(file)
--- a/
README.md
+++ b/
README.md
@@
-1,6
+1,6
@@
# @squeep/totp
# @squeep/totp
-Simple helper
s for dealing with One-Time Passwords
.
+Simple helper
classes for dealing with One-Time Passwords of varying flavor
.
## API
## API
@@
-12,7
+12,7
@@
const key = await TOTP.createKey(); // defaults create a hex-encoded sha1 key
const {
secret, // key encoded as base32
uri, // key and metadata encoded as an otpauth URI
const {
secret, // key encoded as base32
uri, // key and metadata encoded as an otpauth URI
- svg, // otpauth
g
URI encoded as QR code
+ svg, // otpauth URI encoded as QR code
} = TOTP.createKeySVG({ accountname: 'test@example.com', issuer: 'Squeep', }, key, 'hex');
const totp = new TOTP({
} = TOTP.createKeySVG({ accountname: 'test@example.com', issuer: 'Squeep', }, key, 'hex');
const totp = new TOTP({
@@
-21,4
+21,6
@@
const totp = new TOTP({
});
const token = totp.generate(); // The current token for the key.
});
const token = totp.generate(); // The current token for the key.
+
+const isValid = totp.validate('123456');
```
```