🐛 Fix modify password function

This commit is contained in:
C-3PO 2018-07-08 23:29:53 +02:00
parent 58cd6801c7
commit eb8366abdc
Signed by: c3po
GPG key ID: 62993C4BB4D86F24

View file

@ -5,7 +5,7 @@ export default function modifyPassword(passwordIn: Uint8Array) {
for (let i = 0; i < passwordLength; i += 1) { for (let i = 0; i < passwordLength; i += 1) {
if (passwordIn[i] === 0) { break; } if (passwordIn[i] === 0) { break; }
let curChar = passwordIn[i] + (1 << (i % 32)); let curChar = passwordIn[i] + ((1 << (i % 32)) & 0xFF);
if (curChar > 0x7E) { if (curChar > 0x7E) {
if (curChar === 0xFF || curChar === 0x7F) { if (curChar === 0xFF || curChar === 0x7F) {
curChar = 0x3F; curChar = 0x3F;