This commit is contained in:
2025-02-13 12:12:19 -06:00
parent d6aa54e040
commit 1fe2472a51
3 changed files with 7 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
import { randomBytes } from 'crypto';
import { Int64BE, Uint64BE } from 'int64-buffer';
import blake2 from 'blake2';
import blake2b from 'blake2b';
import { TextEncoder } from 'text-encoding';
import { getCustomEncryption } from '../utils/constants';
import {
@@ -156,7 +156,7 @@ export default class packet {
decrypt = async () => {
try {
let hash = blake2.createHash('blake2b', { digestLength: 32 });
let hash = blake2b(32);
hash = hash.update(new TextEncoder().encode(this.token));
const key = Uint8Array.from(hash.digest());
@@ -282,7 +282,7 @@ export default class packet {
encrypt = async (nonce) => {
try {
let hash = blake2.createHash('blake2b', { digestLength: 32 });
let hash = blake2b(32);
hash = hash.update(new TextEncoder().encode(this.token));
const key = Uint8Array.from(hash.digest());