mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
Deps updates
This commit is contained in:
33
node_modules/jwt-simple/README.md
generated
vendored
Normal file
33
node_modules/jwt-simple/README.md
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
# node-jwt-simple
|
||||
|
||||
[JWT(JSON Web Token)](http://self-issued.info/docs/draft-jones-json-web-token.html) encode and decode module for node.js.
|
||||
|
||||
## Install
|
||||
|
||||
$ npm install jwt-simple
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var jwt = require('jwt-simple');
|
||||
var payload = { foo: 'bar' };
|
||||
var secret = 'xxx';
|
||||
|
||||
// encode
|
||||
var token = jwt.encode(payload, secret);
|
||||
|
||||
// decode
|
||||
var decoded = jwt.decode(token, secret);
|
||||
console.log(decoded); //=> { foo: 'bar' }
|
||||
```
|
||||
|
||||
### Algorithms
|
||||
|
||||
By default the algorithm to encode is `HS256`.
|
||||
|
||||
The supported algorithms for encoding and decoding are `HS256`, `HS384`, `HS512` and `RS256`.
|
||||
|
||||
```javascript
|
||||
// encode using HS512
|
||||
jwt.encode(payload, secret, 'HS512')
|
||||
```
|
Reference in New Issue
Block a user