Convert DES into a class
This commit is contained in:
committed by
Lauri Kasanen
parent
7b7295fd4e
commit
075eed5cbb
@@ -1914,11 +1914,8 @@ export default class RFB extends EventTargetMixin {
|
||||
}
|
||||
|
||||
static genDES(password, challenge) {
|
||||
const passwd = [];
|
||||
for (let i = 0; i < password.length; i++) {
|
||||
passwd.push(password.charCodeAt(i));
|
||||
}
|
||||
return (new DES(passwd)).encrypt(challenge);
|
||||
const passwordChars = password.split('').map(c => c.charCodeAt(0));
|
||||
return (new DES(passwordChars)).encrypt(challenge);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user