Skip to content

Commit

Permalink
Fix bug with leading zero in acer insyde 10 code
Browse files Browse the repository at this point in the history
  • Loading branch information
bacher09 committed Jun 6, 2020
1 parent 327fa5f commit 4596541
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/keygen/insyde.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ describe("Acer Insyde 10 BIOS", () => {
expect(acerInsyde10Solver("1373072054")).toEqual(["aebeae5c425684cd"]);
expect(acerInsyde10Solver("1373899792")).toEqual(["a26970a4ffb62d49"]);
expect(acerInsyde10Solver("1395185025")).toEqual(["a763280d9f7396ec"]);
expect(acerInsyde10Solver("1205532638")).toEqual(["0f29abe2243b5a5e"]);
expect(acerInsyde10Solver("1378359327")).toEqual(["0cb381199969833e"]);
expect(acerInsyde10Solver("1880388286")).toEqual(["021df1cd9695387d"]);
expect(acerInsyde10Solver("2025088185")).toEqual(["018261c3cbe60945"]);
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/keygen/insyde.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class Crc64 {
}

public hexdigest(): string {
return this.digest().toString(16);
return ("0".repeat(16) + this.digest().toString(16)).slice(-16);
}
private static makeTable(poly: JSBI): JSBI[] {
let table: JSBI[] = [];
Expand Down

0 comments on commit 4596541

Please sign in to comment.