mirror of
https://github.com/bacher09/pwgen-for-bios.git
synced 2024-09-19 15:28:54 -04:00
Add optimization to badCRC16.
This commit is contained in:
parent
42b0d18427
commit
2793ea2171
2 changed files with 2 additions and 2 deletions
|
@ -130,9 +130,9 @@ function badCRC16(pwd, salt){
|
|||
salt = (typeof(salt) == 'undefined') ? 0 : salt;
|
||||
var hash = salt;
|
||||
var c = 0;
|
||||
for(c in pwd){
|
||||
for(var c=0;c < pwd.length;c++){
|
||||
hash ^= pwd[c] ;
|
||||
for(var i=0;i<8;i++){
|
||||
for(var i=8;i--;){
|
||||
if(hash & 1){
|
||||
hash = (hash >> 1) ^ 0x2001;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue