Skip to content

Commit

Permalink
Use crc instead of buffer-crc32 for speed
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Sep 16, 2014
1 parent 7eb65ee commit f6ac068
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
3.x
===

* Use `crc` instead of `buffer-crc32` for speed
* deps: connect@2.26.1
- deps: body-parser@~1.8.2
- deps: depd@0.4.5
Expand Down
4 changes: 2 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* Module dependencies.
*/

var crc = require('crc').crc32;
var mime = require('connect').mime
, proxyaddr = require('proxy-addr')
, crc32 = require('buffer-crc32')
, crypto = require('crypto');
var typer = require('media-typer');

Expand Down Expand Up @@ -56,7 +56,7 @@ exports.wetag = function wetag(body, encoding){
? body
: new Buffer(body, encoding)
var len = buf.length
return 'W/"' + len.toString(16) + '-' + crc32.unsigned(buf) + '"'
return 'W/"' + len.toString(16) + '-' + crc(buf) + '"'
};

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
"homepage": "http://expressjs.com/",
"dependencies": {
"basic-auth": "1.0.0",
"buffer-crc32": "0.2.3",
"connect": "2.26.1",
"commander": "1.3.2",
"cookie-signature": "1.0.5",
"crc": "3.0.0",
"debug": "~2.0.0",
"depd": "0.4.5",
"escape-html": "1.0.1",
Expand Down

0 comments on commit f6ac068

Please sign in to comment.