use xxh128 instead of xxh64

This commit is contained in:
Ashley 2024-08-27 19:59:21 +00:00
parent cca482079c
commit 38354be315

View file

@ -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) {