From 10044b6749fc08fed83d89653a1acacbf792fa56 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Sun, 26 Nov 2017 18:26:56 +0000 Subject: [PATCH] Switch to xxhash to save farmhash jiggery-pokery when initialising Docker image --- core/art.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/art.js b/core/art.js index 28657fc0..19e0bafe 100644 --- a/core/art.js +++ b/core/art.js @@ -14,7 +14,7 @@ const paths = require('path'); const assert = require('assert'); const iconv = require('iconv-lite'); const _ = require('lodash'); -const farmhash = require('farmhash'); +const xxhash = require('xxhash'); exports.getArt = getArt; exports.getArtFromPath = getArtFromPath; @@ -288,7 +288,7 @@ function display(client, art, options, cb) { } if(!options.disableMciCache) { - artHash = farmhash.hash32(art); + artHash = xxhash.hash(new Buffer(art), 0xCAFEBABE); // see if we have a mciMap cached for this art if(client.mciCache) { diff --git a/package.json b/package.json index 29bd16da..566a454d 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ "buffers": "NuSkooler/node-buffers", "bunyan": "^1.8.12", "exiftool": "^0.0.3", - "farmhash": "^2.0.4", "fs-extra": "^4.0.1", "graceful-fs": "^4.1.11", "hashids": "^1.1.1", @@ -52,6 +51,7 @@ "uuid": "^3.1.0", "uuid-parse": "^1.0.0", "ws": "^3.1.0", + "xxhash": "^0.2.4", "yazl" : "^2.4.2" }, "devDependencies": {},