diff --git a/lib/ext.js b/lib/ext.js index 76f19d5..1221fcd 100644 --- a/lib/ext.js +++ b/lib/ext.js @@ -1,8 +1,9 @@ -import { xxh64 } from "@node-rs/xxhash"; +import { xxh3 } from "@node-rs/xxhash"; import { encode } from "html-entities"; import { JSDOM } from "jsdom"; import util from "util"; import fs from "fs"; +const xxh128 = xxh3.xxh128; Array.prototype.random = function(){return this[Math.floor(Math.random() * this.length)]} @@ -24,7 +25,7 @@ export default function(client) { client.config = { get: (key) => { - var configFile = "data/" + xxh64(key).toString(16) + ".json"; + var configFile = "data/" + xxh128(key).toString(16) + ".json"; var configData = {}; if(fs.existsSync(configFile)) { configData = JSON.parse(fs.readFileSync(configFile)); @@ -109,7 +110,7 @@ export default function(client) { client.error = client.log; client.uploadBuffer = async function(buffer) { - var hash = xxh64(buffer).toString(16); + var hash = xxh128(buffer).toString(16); var matrixUrl = client.cache.get(hash); if(!matrixUrl) {