redis.token
Advanced tools
Comparing version 0.1.1 to 0.1.2
10
index.js
@@ -5,2 +5,3 @@ //Dependencies | ||
var config = {} | ||
var secret = "redis.token" | ||
var client | ||
@@ -13,11 +14,6 @@ | ||
config = {} | ||
config.ttl = 3600 | ||
config.key = "redis.token" | ||
} else { | ||
if (!config.ttl) config.ttl = 3600 | ||
if (!config.key) config.key = "redis.token" | ||
} | ||
//Create the client | ||
client = redis.createClient() | ||
client = redis.createClient(config) | ||
@@ -39,3 +35,3 @@ //Throw errors if there are any | ||
}) | ||
var rKey = crypto.SHA3(config.key + Math.random()).toString() | ||
var rKey = crypto.SHA3(secret + Math.random()).toString() | ||
client.hmset(rKey,data, function(err,res) { | ||
@@ -42,0 +38,0 @@ if (err) throw err |
{ | ||
"name": "redis.token", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": " token based storage system in Redis that uses hashtables.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -27,4 +27,13 @@ [![Build Status](https://travis-ci.org/ChrisCates/redis.token.svg?branch=master)](https://travis-ci.org/ChrisCates/redis.token) | ||
``` | ||
var redis = require("redis.token") | ||
var config = { | ||
host: "localhost", | ||
port: 6379, | ||
path: null, | ||
url: null, | ||
//etc (refer to redis npm docs for full configuration) | ||
} | ||
var redis = require("redis.token")(config) | ||
redis.generate( | ||
@@ -31,0 +40,0 @@ { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5385
69
69