mirror of
https://github.com/Ingan121/Vineless.git
synced 2026-04-02 10:38:23 +00:00
18 lines
539 B
JavaScript
18 lines
539 B
JavaScript
export class Key {
|
|
constructor(key_id, key_type, cipher_type, key) {
|
|
this.key_id = this._swapEndianess(key_id);
|
|
this.key_type = key_type;
|
|
this.cipher_type = cipher_type;
|
|
this.key = key;
|
|
}
|
|
|
|
_swapEndianess(uuidBytes) {
|
|
return new Uint8Array([
|
|
uuidBytes[3], uuidBytes[2], uuidBytes[1], uuidBytes[0],
|
|
uuidBytes[5], uuidBytes[4],
|
|
uuidBytes[7], uuidBytes[6],
|
|
uuidBytes[8], uuidBytes[9],
|
|
...uuidBytes.slice(10, 16)
|
|
]);
|
|
}
|
|
} |