Skip to content

Commit

Permalink
[readme] Added usage example for getting an otpauth:// URL for non-SH…
Browse files Browse the repository at this point in the history
…A1 algorithms
  • Loading branch information
markbao committed Jan 24, 2016
1 parent aef32f4 commit d4486a3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,19 @@ var token = speakeasy.totp({
});
```

#### Getting an otpauth:// URL and QR code for non-SHA1 hash algorithms

```js
// Generate a secret, if needed
var secret = speakeasy.generateSecret();
// By default, generateSecret() returns an otpauth_url for SHA1

// Use otpauthURL() to get a custom authentication URL for SHA512
var url = speakeasy.otpauthURL({ secret: secret.ascii, label: 'Name of Secret', algorithm: 'sha512' });

// Pass URL into a QR code generator
```

<a name="documentation"></a>
## Documentation

Expand Down

0 comments on commit d4486a3

Please sign in to comment.