From 6c906d2ef99b08ce61f9f8e6f22ec6da33a60a14 Mon Sep 17 00:00:00 2001 From: Amit Panwar <64302444+amitpanwar789@users.noreply.github.com> Date: Sun, 11 Dec 2022 21:31:57 +0530 Subject: [PATCH] Removed unused functions from util.js #843 (#938) Authored by 64302444+amitpanwar789@users.noreply.github.com --- www/js/lib/util.js | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/www/js/lib/util.js b/www/js/lib/util.js index 69f0f7bd..a6f69fcc 100644 --- a/www/js/lib/util.js +++ b/www/js/lib/util.js @@ -113,30 +113,6 @@ define([], function() { return str.indexOf(suffix, str.length - suffix.length) !== -1; } - /** - * Read an integer encoded in 4 bytes, little endian - * @param {Array} byteArray - * @param {Integer} firstIndex - * @returns {Integer} - */ - function readIntegerFrom4Bytes(byteArray, firstIndex) { - var dataView = new DataView(byteArray.buffer, firstIndex, 4); - var integer = dataView.getUint32(0, true); - return integer; - } - - /** - * Read an integer encoded in 2 bytes, little endian - * @param {Array} byteArray - * @param {Integer} firstIndex - * @returns {Integer} - */ - function readIntegerFrom2Bytes(byteArray, firstIndex) { - var dataView = new DataView(byteArray.buffer, firstIndex, 2); - var integer = dataView.getUint16(0, true); - return integer; - } - /** * Read a float encoded in 2 bytes * @param {Array} byteArray @@ -150,22 +126,6 @@ define([], function() { return float; } - /** - * Convert a Uint8Array to a lowercase hex string - * @param {Array} byteArray - * @returns {String} - */ - function uint8ArrayToHex(byteArray) { - var s = ''; - var hexDigits = '0123456789abcdef'; - for (var i = 0; i < byteArray.length; i++) { - var v = byteArray[i]; - s += hexDigits[(v & 0xff) >> 4]; - s += hexDigits[v & 0xf]; - } - return s; - } - /** * Reads a Uint8Array from the given file starting at byte offset begin until end * @param {File} file The file object to be read @@ -240,10 +200,7 @@ define([], function() { allCaseFirstLetters: allCaseFirstLetters, removeDuplicateStringsInSmallArray: removeDuplicateStringsInSmallArray, endsWith: endsWith, - readIntegerFrom4Bytes: readIntegerFrom4Bytes, - readIntegerFrom2Bytes: readIntegerFrom2Bytes, readFloatFrom4Bytes: readFloatFrom4Bytes, - uint8ArrayToHex: uint8ArrayToHex, readFileSlice: readFileSlice, binarySearch: binarySearch, leftShift: leftShift