mirror of
https://github.com/laochan-eacnet/backend.git
synced 2026-10-01 19:17:59 +03:00
14 lines
355 B
TypeScript
14 lines
355 B
TypeScript
import { createHash } from "crypto";
|
|
import rc4 from 'arc4';
|
|
|
|
const EAMUSE_RC4_KEY = '69D74627D985EE2187161570D08D93B12455035B6DF0D8205DF5';
|
|
|
|
export function rc4Transfrom(keyHex: string, data: Buffer) {
|
|
const key = createHash('md5')
|
|
.update(keyHex + EAMUSE_RC4_KEY, 'hex')
|
|
.digest();
|
|
|
|
return rc4('arc4', key)
|
|
.encodeBuffer(data)
|
|
}
|