Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

hashlib is totally b0rken on debian sid #1

Open
wants to merge 3 commits into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 23, 2011
  1. @dodo
  2. @dodo
  3. @dodo

    damn json

    dodo authored
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 7 deletions.
  1. +1 −1  backend/backend.js
  2. +1 −2  package.json
  3. +7 −4 src/flexcache.coffee
View
2  backend/backend.js
@@ -1 +1 @@
-module.exports = require('../build/default/backend/backend.js')
+module.exports = require('../build/default/backend/base.js')
View
3  package.json
@@ -17,8 +17,7 @@
"buffalo": "0.1.x",
"quack-array": "0.0.x",
"redis": "0.6.x",
- "async": "0.1.x",
- "hashlib": "https://github.com/poelzi/hashlib/tarball/master"
+ "async": "0.1.x"
}
, "devDependencies": {
"garbage": "0.0.0",
View
11 src/flexcache.coffee
@@ -10,11 +10,14 @@ redis = require 'redis'
buffalo = require 'buffalo'
async = require 'async'
quack = require 'quack-array'
-hashlib = require('hashlib')
+crypto = require 'crypto'
assert = require('assert')
{ EventEmitter } = require('events')
+sha256 = (data) ->
+ hash = crypto.createHash('sha256')
+ hash.update(data)
+ hash.digest('hex')
-
class Flexcache
constructor: (@backend, options, callback) ->
# set default hasher
@@ -45,10 +48,10 @@ class Flexcache
return JSON.stringify(args)
safe_hasher_one: (x) =>
- return hashlib.sha256(buffalo.serialize([x]))
+ return sha256(buffalo.serialize([x]))
safe_hasher_all: (args...) =>
- return hashlib.sha256(buffalo.serialize(args))
+ return sha256(buffalo.serialize(args))
get_group: (args...) =>
return @options.group_prefix + @group.apply(null, args)
Something went wrong with that request. Please try again.