From b6e3dee587caed8fc7a7bb1dd29f522e7b0650ea Mon Sep 17 00:00:00 2001 From: Slava Bacherikov Date: Fri, 22 Jul 2016 20:46:07 +0300 Subject: [PATCH] Remove div function --- scripts/decrypt_bios.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/decrypt_bios.ts b/scripts/decrypt_bios.ts index e779cb0..772da53 100644 --- a/scripts/decrypt_bios.ts +++ b/scripts/decrypt_bios.ts @@ -36,11 +36,6 @@ namespace Utils { 34: "g", 35: "h", 36: "j", 37: "k", 38: "l", 44: "z", 45: "x", 46: "c", 47: "v", 48: "b", 49: "n", 50: "m" }; - // Integer divide - // TODO: Possible update this code - export function div(a: number, b: number): number { - return a / b - a % b / b; - } /* Decode Keyboard code to Ascii symbol */ export function keyboardEncToAscii(inKey: number[]): string { let out = ""; @@ -105,7 +100,7 @@ function SamsungSolver(serial: string): string[] { } let hash: number[] = []; - for (let i = 1; i < Utils.div(serial.length, 2); i++) { + for (let i = 1; i < Math.floor(serial.length / 2); i++) { let val = parseInt(serial.charAt(2 * i) + serial.charAt(2 * i + 1), 16); hash.push(val); }