2.0.x fixes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { randomBytes } from 'crypto';
|
||||
import { Int64BE, Uint64BE } from 'int64-buffer';
|
||||
import crypto from 'crypto';
|
||||
import blake2 from 'blake2';
|
||||
import { TextEncoder } from 'text-encoding';
|
||||
import { getCustomEncryption } from '../utils/constants';
|
||||
import {
|
||||
@@ -156,7 +156,7 @@ export default class packet {
|
||||
|
||||
decrypt = async () => {
|
||||
try {
|
||||
let hash = crypto.createHash('sha256');
|
||||
let hash = blake2.createHash('blake2b', { digestLength: 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 = crypto.createHash('sha256');
|
||||
let hash = blake2.createHash('blake2b', { digestLength: 32 });
|
||||
hash = hash.update(new TextEncoder().encode(this.token));
|
||||
|
||||
const key = Uint8Array.from(hash.digest());
|
||||
|
||||
Reference in New Issue
Block a user