This file contains 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 crypto = require('crypto'); | |
const fs = require('fs'); | |
const data = fs.readFileSync('./data.txt'); | |
const key = fs.readFileSync('./private_key.pem'); | |
const pub = fs.readFileSync('./public_key.pem'); | |
console.log('data:', data); | |
console.log('key:', key.toString('base64')); | |
const sign = crypto.sign(null, data, key); |
This file contains 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
//兩邊都一樣 | |
var kue = require('kue'); | |
var redis = require('redis'); | |
kue.redis.createClient = function() { | |
var client = redis.createClient(port, host); | |
client.auth(password); | |
return client; | |
}; |