mirror of
https://github.com/nextcloud/passman.git
synced 2025-02-26 00:14:44 +08:00
Fix 16 Bits Codes
Signed-off-by: ZanderCodes <admin@zandercodes.com>
This commit is contained in:
parent
2abc72b02e
commit
4384f8e4de
1 changed files with 2 additions and 6 deletions
|
@ -52,16 +52,12 @@
|
|||
var val = base32chars.indexOf(base32.charAt(i).toUpperCase());
|
||||
bits += leftpad(val.toString(2), 5, '0');
|
||||
}
|
||||
|
||||
for (i = i % 8; i > 0; i--) {
|
||||
bits += leftpad('0', 5, '0');
|
||||
}
|
||||
|
||||
for (i = 0; i + 4 <= bits.length; i += 4) {
|
||||
var chunk = bits.substr(i, 4);
|
||||
hex = hex + parseInt(chunk, 2).toString(16);
|
||||
}
|
||||
return hex;
|
||||
return hex.length % 2 ? hex + "0" : hex;
|
||||
|
||||
}
|
||||
|
||||
|
@ -128,4 +124,4 @@
|
|||
};
|
||||
}
|
||||
]);
|
||||
}());
|
||||
}());
|
||||
|
|
Loading…
Reference in a new issue