From 8259b6241c1da36fc6a3861fb9c33f0fd19252ce Mon Sep 17 00:00:00 2001 From: Slava Bacherikov Date: Wed, 28 Aug 2019 18:43:00 +0300 Subject: [PATCH] Add tests for Dell HDD 1F5A --- README.md | 2 +- src/keygen/dell.spec.ts | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 12d7d0a..5a31324 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Latest released version available [here][bios-pw] and latest testing version (*s * Asus — current BIOS date. For example: ``01-02-2013`` * Compaq — 5 decimal digits (*e.g*. ``12345``) -* Dell — supports such series: ``595B``, ``D35B``, ``2A7B``, ``A95B``, ``1D3B``, ``6FF1`` and ``1F66``. *e.g*: ``1234567-2A7B`` or ``1234567890A-D35B`` for HDD. +* Dell — supports such series: ``595B``, ``D35B``, ``2A7B``, ``A95B``, ``1D3B``, ``6FF1``, ``1F66`` and ``1F5A``. *e.g*: ``1234567-2A7B`` or ``1234567890A-D35B`` for HDD. * Fujitsu-Siemens — 5 decimal digits, 8 hexadecimal digits, 5x4 hexadecimal digits, 5x4 decimal digits * Hewlett-Packard — 5 decimal digits, 10 characters * Insyde H20 (Acer, HP) — 8 decimal digits diff --git a/src/keygen/dell.spec.ts b/src/keygen/dell.spec.ts index 687ad6f..7cf6f94 100644 --- a/src/keygen/dell.spec.ts +++ b/src/keygen/dell.spec.ts @@ -97,6 +97,11 @@ describe("Test calculateSuffix", () => { let suffix = checkSuffix("12345678901", DellTag.Tag1F66, SuffixType.HDD); expect(suffix).toEqual([48, 114, 79, 71, 55, 48, 49, 83]); }); + + it("Check hdd suffix for: 12345678901-1F5A", () => { + let suffix = checkSuffix("12345678901", DellTag.Tag1F5A, SuffixType.HDD); + expect(suffix).toEqual([48, 51, 113, 98, 107, 48, 99, 115]); + }); }); describe("Test keygenDell", () => { @@ -200,7 +205,14 @@ describe("Test keygenDell", () => { expect(keygenDell("1234567890A", DellTag.Tag6FF1, SuffixType.HDD)) .toEqual("5enLLpM3Immfb8CK"); }); - // TODO: add HDD 1F5A + it("Dell HDD password for: 1234567890A-1F5A", () => { + expect(keygenDell("1234567890A", DellTag.Tag1F5A, SuffixType.HDD)) + .toEqual("L9IJjYoUIXeY5wOy"); + }); + it("Dell HDD password for: 12345678901-1F5A", () => { + expect(keygenDell("12345678901", DellTag.Tag1F5A, SuffixType.HDD)) + .toEqual("QwO5Dki1zeR1n1t2"); + }); }); describe("Test Dell BIOS", () => {