Skip to content

Commit

Permalink
Make dell service tags case insensitive
Browse files Browse the repository at this point in the history
Dell service tag is always uppercase, so there is no point in allowing
lowercase input. This supposed reduce amount of errors users can make
when generating password.
  • Loading branch information
bacher09 committed Feb 19, 2022
1 parent da4fd08 commit dc3a8cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/keygen/dell.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@ describe("Test Dell BIOS", () => {
it("Dell for: 1234567-1F66", () => {
expect(dellSolver("1234567-1f66")).toEqual(["kIpTBzx0m3s10JDR"]);
});
it("Dell for: 123456a-1F66", () => {
// AFAIK Dell service tags is always uppercase
// so this supposed to calculate password for 123456A-1F66
expect(dellSolver("123456a-1f66")).toEqual(["5sS11TUKBmBOQKRS"]);
});
it("Dell HDD for: 1234567890A-595B", () => {
expect(dellHddSolver("1234567890A-595b")).toEqual(["nyoap4lq"]);
});
Expand All @@ -336,5 +341,6 @@ describe("Latitude 3540", () => {
});
it("Dell Latitude 3540 Solver", () => {
expect(dellLatitude3540Solver("5F3988D5E0ACE4BF-7QH8602")).toEqual(["98072364"]);
expect(dellLatitude3540Solver("5F3988D5E0ACE4bF-7QH8602")).toEqual(["98072364"]);
});
});
8 changes: 4 additions & 4 deletions src/keygen/dell/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ export let dellSolver = makeSolver({
}
},
fun: (password: string) => {
let suffix = password.slice(7, 11).toUpperCase();
return keygenDell(password.slice(0, 7), suffix as DellTag, SuffixType.ServiceTag);
const suffix = password.slice(7, 11).toUpperCase();
return keygenDell(password.slice(0, 7).toUpperCase(), suffix as DellTag, SuffixType.ServiceTag);
}
});

Expand All @@ -274,8 +274,8 @@ export let dellHddSolver = makeSolver({
}
},
fun: (password: string) => {
let suffix = password.slice(11, 15).toUpperCase();
return keygenDell(password.slice(0, 11), suffix as DellTag, SuffixType.HDD);
const suffix = password.slice(11, 15).toUpperCase();
return keygenDell(password.slice(0, 11).toUpperCase(), suffix as DellTag, SuffixType.HDD);
}
});

Expand Down

0 comments on commit dc3a8cb

Please sign in to comment.