- Originally published: June 7, 2015
- Revised date: April 21, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ###################################################################### | |
| # The ASCII lightsaber # | |
| # # | |
| # By: Jansen Price <jansen.price@gmail.com> # | |
| # November 19, 2015 # | |
| # ▁▁▁▁▁▁▁▁▁▁▁▁▁ ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ # | |
| # |▍░▐░░▣░▒░▒░▒▕| ▌ # | |
| # ▔▔▔▔▔▔▔▔▔▝▔▔▔ ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require('fs'); | |
| const jwt = require('jsonwebtoken'); | |
| // http://travistidwell.com/blog/2013/09/06/an-online-rsa-public-and-private-key-generator/ | |
| // use 'utf8' to get string instead of byte array (1024 bit key) | |
| var privateKEY = fs.readFileSync('./private.key', 'utf8'); // to sign JWT | |
| var publicKEY = fs.readFileSync('./public.key', 'utf8'); // to verify JWT | |
| module.exports = { | |
| sign: (payload, $Options) => { | |
| /* |
OlderNewer