UNPKG
faye-redis-sharded
Version:
latest (0.2.4)
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.1
0.1.0
Redis backend engine for Faye with support for sharding
faye-redis-sharded
/
lib
/
sharding
/
algorithms
/
crypto-hash.js
11 lines
(8 loc)
•
255 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
var
crypto =
require
(
'crypto'
);
function
CryptoHash
(
algorithm
){
this
.
algorithm
= algorithm ||
'md5'
; }
CryptoHash
.
prototype
.
getHash
=
function
(
key
){
return
crypto.
createHash
(
this
.
algorithm
).
update
(key).
digest
(
'hex'
); };
module
.
exports
=
CryptoHash
;