more optimizations
This commit is contained in:
@@ -218,7 +218,7 @@ for(var loop = 0; loop < vCount; loop++) {
|
||||
<!-- draw Try It button if the info has been passed from the service -->
|
||||
appUrl = document.formInfo.tryItUrl.value;
|
||||
if (appUrl != "" ) {
|
||||
if ( appUrl.substring(0,10) == "wtv-tricks" ) {
|
||||
if ( appUrl.slice(0,10) == "wtv-tricks" ) {
|
||||
if ( document.formInfo.tryItLabel.value.length == 4 ) {
|
||||
document.write("<input onclick='tryApp()' value='Try " + document.formInfo.tryItLabel.value + "' borderimage='file://ROM/Borders/ButtonBorder2.bif' type=button usestyle width=110>");
|
||||
} else {
|
||||
|
||||
@@ -224,11 +224,11 @@ document.indexForm.indexSubcat.value = "0";
|
||||
drawAll();
|
||||
}
|
||||
function goToPage(a,b) { str = subCatUrl[a][b];
|
||||
if (str.substring(0,4) == "faq:") { goToStr = str.substring(4,str.length);
|
||||
if (str.slice(0,4) == "faq:") { goToStr = str.slice(4,str.length);
|
||||
goToHelpCenter(goToStr);
|
||||
} else if (str.substring(0,9) == "non-help:") { goToStr = str.substring(9,str.length);
|
||||
} else if (str.slice(0,9) == "non-help:") { goToStr = str.slice(9,str.length);
|
||||
goToUrl(goToStr);
|
||||
} else if (str.substring(0,7) == "newFAQ:") { goToStr = str.substring(7,str.length);
|
||||
} else if (str.slice(0,7) == "newFAQ:") { goToStr = str.slice(7,str.length);
|
||||
goToFAQURL(goToStr);
|
||||
} else { goToStr = ('wtv-guide:/help?' + str);
|
||||
goToUrl(goToStr);
|
||||
@@ -279,13 +279,13 @@ go back to it. If not, just go to it. If wholeString is
|
||||
specified, it looks for perfect matches of the whole string.
|
||||
*/
|
||||
ind = gvnStr.indexOf("wtv-token");
|
||||
if (ind > -1) { gvnStr = gvnStr.substring(0,ind);
|
||||
if (ind > -1) { gvnStr = gvnStr.slice(0,ind);
|
||||
}
|
||||
window.message("gvnStr=" + gvnStr);
|
||||
foundInBackList = false;
|
||||
for (i=history.length; i--; i>0 ) { if ( wholeString != null ) { testStr = history[i];
|
||||
} else { str = history[i];
|
||||
testStr = str.substring(0, gvnStr.length);
|
||||
testStr = str.slice(0, gvnStr.length);
|
||||
}
|
||||
if ( testStr == gvnStr ) { i++;
|
||||
foundInBackList = true;
|
||||
|
||||
@@ -106,7 +106,7 @@ function getPatchDataType(type, invert = false) {
|
||||
|
||||
function getResData(file) {
|
||||
var res_data = null;
|
||||
if (file.substr(-2, 2).toLowerCase() == "gz") {
|
||||
if (file.slice(-2, 2).toLowerCase() == "gz") {
|
||||
var res_gz_data = wtvshared.getServiceDep("/viewergen/" + file);
|
||||
res_data = zlib.gunzipSync(res_gz_data);
|
||||
} else {
|
||||
@@ -228,34 +228,34 @@ function getPatchData(fname, client_data_obj, start_url = "client:GoToConn", def
|
||||
if (typeof val === 'string') {
|
||||
// start url override
|
||||
if (start_url != patch_defaults.start_url && start_url.length <= patch_limits.start_url) {
|
||||
if (val.substr(0, patch_defaults.start_url.length) == patch_defaults.start_url)
|
||||
if (val.slice(0, patch_defaults.start_url.length) == patch_defaults.start_url)
|
||||
customized_patch_data[idx] = start_url + "\x00";
|
||||
}
|
||||
|
||||
// default service ip override
|
||||
if (default_ip != patch_defaults.default_ip && default_ip.length <= patch_limits.default_ip) {
|
||||
if (val.substr(0, patch_defaults.default_ip.length) == patch_defaults.default_ip)
|
||||
if (val.slice(0, patch_defaults.default_ip.length) == patch_defaults.default_ip)
|
||||
customized_patch_data[idx] = default_ip + "\x00";
|
||||
}
|
||||
} else {
|
||||
if (!val.byteLength) {
|
||||
// not a buffer object
|
||||
var block_length = val['length'];
|
||||
var patch_data = getPatchDataType(val['type'], (fname.substr(12, 3) != "1.1"));
|
||||
var patch_data = getPatchDataType(val['type'], (fname.slice(12, 3) != "1.1"));
|
||||
if (patch_data) {
|
||||
var patch_data_array = patch_data.split("\r\n");
|
||||
var patch_data_string = "";
|
||||
Object.keys(patch_data_array).forEach(function (didx) {
|
||||
var header_end = patch_data_array[didx].indexOf(":");
|
||||
if (header_end) {
|
||||
var patch_data_header = patch_data_array[didx].substr(0, header_end);
|
||||
var patch_data_header = patch_data_array[didx].slice(0, header_end);
|
||||
var client_value = client_data_obj[patch_data_header];
|
||||
if (client_value)
|
||||
patch_data_string += patch_data_array[didx].replace("%s", client_value) + "\r\n";
|
||||
}
|
||||
});
|
||||
}
|
||||
if (fname.substr(12, 3) != "2.5") {
|
||||
if (fname.slice(12, 3) != "2.5") {
|
||||
var length_difference = block_length - patch_data_string.length;
|
||||
if (length_difference > 0)
|
||||
patch_data_string += "\x00".repeat(length_difference - (val['type'].length + 1));
|
||||
@@ -493,8 +493,8 @@ if (request_headers.query.viewer &&
|
||||
var patched_file = patchBinary(patchDataObject);
|
||||
var enabled_feature_bits = [];
|
||||
Object.keys(request_headers.query).forEach((k) => {
|
||||
if (k.substring(0, 12) === "feature_bit_") {
|
||||
enabled_feature_bits.push(parseInt(k.substring(12)));
|
||||
if (k.slice(0, 12) === "feature_bit_") {
|
||||
enabled_feature_bits.push(parseInt(k.slice(12)));
|
||||
}
|
||||
});
|
||||
Object.keys(enabled_feature_bits).forEach((k) => {
|
||||
@@ -553,8 +553,8 @@ Content-Disposition: attachment; filename="${viewer_file.replace(".exe", ".zip")
|
||||
|
||||
var embed_modpacks = [];
|
||||
Object.keys(request_headers.query).forEach((k) => {
|
||||
if (k.substring(0, 8) === "modpack_") {
|
||||
embed_modpacks.push(parseInt(k.substring(8)));
|
||||
if (k.slice(0, 8) === "modpack_") {
|
||||
embed_modpacks.push(parseInt(k.slice(8)));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -601,9 +601,9 @@ window.onload = function() {
|
||||
|
||||
function getSSIDCRC(ssid) {
|
||||
let crc = 0;
|
||||
var ssid = ssid.substr(0, 14);
|
||||
var ssid = ssid.slice(0, 14);
|
||||
for (let i = 0; i < ssid.length; i += 2) {
|
||||
let inbyte = parseInt(ssid.substring(i, i+2), 16);
|
||||
let inbyte = parseInt(ssid.slice(i, i+2), 16);
|
||||
for (let ii = 8; ii > 0; ii--) {
|
||||
let mix = (crc ^ inbyte) & 0x01;
|
||||
crc >>= 1;
|
||||
@@ -667,9 +667,9 @@ function validateSSID(ssid) {
|
||||
alert("Please choose a valid SSID and try again.");
|
||||
return false;
|
||||
}
|
||||
if ((ssid.substr(0,1) != "0" && ssid.substr(0,1) != "8" && ssid.substr(0,1) != "9") ||
|
||||
(ssid.substr(6,1) != "0") ||
|
||||
(ssid.substr(9,5) != "0b002")) {
|
||||
if ((ssid.slice(0,1) != "0" && ssid.slice(0,1) != "8" && ssid.slice(0,1) != "9") ||
|
||||
(ssid.slice(6,1) != "0") ||
|
||||
(ssid.slice(9,5) != "0b002")) {
|
||||
alert("Your SSID is not proper, but I'll allow it.")
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
var minisrv_service_file = true;
|
||||
|
||||
var mailto = request_headers.request_url;
|
||||
mailto = mailto.substring(mailto.indexOf(":") + 1);
|
||||
mailto = mailto.slice(mailto.indexOf(":") + 1);
|
||||
mailto = mailto.split("?")[0];
|
||||
var subject = request_headers.query.subject || "";
|
||||
var body = request_headers.query.body || "";
|
||||
|
||||
@@ -143,7 +143,7 @@ if (session_data.data_store.wtvsec_login) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (socket.ssid.substr(0, 8) == "MSTVSIMU") {
|
||||
if (socket.ssid.slice(0, 8) == "MSTVSIMU") {
|
||||
prereg_contype = "text/dialscript";
|
||||
var file_path = wtvshared.getServiceDep("/wtv-1800/tellyscripts/UTV/utv_hsd.tok", true);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ class WTVAuthor {
|
||||
this.debug("createPage","pages",pages)
|
||||
var pagenums = [];
|
||||
for(let i = 0; i < pagelen; i++) {
|
||||
var toarr = pages[i].substr(0, pages[i].indexOf('.'));
|
||||
var toarr = pages[i].slice(0, pages[i].indexOf('.'));
|
||||
pagenums.push(parseInt(toarr));
|
||||
}
|
||||
pagenums = pagenums.sort()
|
||||
@@ -469,7 +469,7 @@ this.fs.writeFile(destDir + this.wtvclient.session_store.subscriber_username + '
|
||||
break;
|
||||
|
||||
case "clipart":
|
||||
this.fs.mkdirSync(destDir + this.wtvclient.session_store.subscriber_username + '/' + pagedata.publishname + "/" + atob(thisblock.photo).substr(0, atob(thisblock.photo).lastIndexOf("/")), { recursive: true })
|
||||
this.fs.mkdirSync(destDir + this.wtvclient.session_store.subscriber_username + '/' + pagedata.publishname + "/" + atob(thisblock.photo).slice(0, atob(thisblock.photo).lastIndexOf("/")), { recursive: true })
|
||||
this.fs.copyFile('includes/ServiceVault/wtv-author/' + atob(thisblock.photo), destDir + this.wtvclient.session_store.subscriber_username + '/' + pagedata.publishname + "/" + atob(thisblock.photo), (err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
@@ -840,7 +840,7 @@ html += `">next page</a>
|
||||
var publishname = null;
|
||||
|
||||
if (pagedata.published != true) {
|
||||
publishname = pagedata.title.substring(0, 50).replaceAll(" ", "").replace(/[^A-Za-z0-9]/g, "-");
|
||||
publishname = pagedata.title.slice(0, 50).replaceAll(" ", "").replace(/[^A-Za-z0-9]/g, "-");
|
||||
pagedata.publishname = publishname;
|
||||
this.editPage(pagedata, pagenum);
|
||||
if (this.fs.existsSync(destDir + this.wtvclient.session_store.subscriber_username + '/' + publishname)) {
|
||||
@@ -867,7 +867,7 @@ html += `">next page</a>
|
||||
});
|
||||
}
|
||||
for (let i = 0; i < this.stylemedia.length; i++) {
|
||||
this.fs.mkdirSync(destDir + this.wtvclient.session_store.subscriber_username + '/' + publishname + this.stylemedia[i].substr(0, this.stylemedia[i].lastIndexOf("/")), { recursive: true })
|
||||
this.fs.mkdirSync(destDir + this.wtvclient.session_store.subscriber_username + '/' + publishname + this.stylemedia[i].slice(0, this.stylemedia[i].lastIndexOf("/")), { recursive: true })
|
||||
this.fs.copyFile('includes/ServiceVault/wtv-author' + this.stylemedia[i], destDir + this.wtvclient.session_store.subscriber_username + '/' + publishname + this.stylemedia[i], (err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
@@ -1331,10 +1331,10 @@ class WTVBGMusic {
|
||||
getSongCategory(songid) {
|
||||
if (String(songid).length === 3) {
|
||||
// 3 digit song id
|
||||
return parseInt(String(songid).substr(0, 1));
|
||||
return parseInt(String(songid).slice(0, 1));
|
||||
} else if (String(songid).length === 4) {
|
||||
// 4 digit song id
|
||||
return parseInt(String(songid).substr(0, 2));
|
||||
return parseInt(String(songid).slice(0, 2));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -1353,10 +1353,10 @@ class WTVBGMusic {
|
||||
musiclist[k].id = k;
|
||||
if (String(category).length === 1) {
|
||||
// 3 digit song id
|
||||
if (parseInt(k.substr(0, 1)) == parseInt(category) && String(k).length === 3) songList.push(musiclist[k]);
|
||||
if (parseInt(k.slice(0, 1)) == parseInt(category) && String(k).length === 3) songList.push(musiclist[k]);
|
||||
} else if (String(category).length === 2) {
|
||||
// 4 digit song id
|
||||
if (parseInt(k.substr(0, 2)) == parseInt(category) && String(k).length === 4) songList.push(musiclist[k]);
|
||||
if (parseInt(k.slice(0, 2)) == parseInt(category) && String(k).length === 4) songList.push(musiclist[k]);
|
||||
}
|
||||
});
|
||||
return songList.filter(value => Object.keys(value).length !== 0);
|
||||
|
||||
@@ -99,7 +99,7 @@ class WTVClientCapabilities {
|
||||
//In case remaining hex length (or initial) is not multiple of 8
|
||||
var blockSize = remainingSize < 8 ? remainingSize : 8;
|
||||
|
||||
binary += parseInt(hex.substr(p * 8, blockSize), 16).toString(2);
|
||||
binary += parseInt(hex.slice(p * 8, blockSize), 16).toString(2);
|
||||
|
||||
remainingSize -= blockSize;
|
||||
}
|
||||
|
||||
@@ -610,7 +610,7 @@ class WTVClientSessionData {
|
||||
Object.keys(cookie_data).forEach(function (k) {
|
||||
outstring += k + "=" + escape(cookie_data[k]) + "&";
|
||||
});
|
||||
return outstring.substring(0, outstring.length - 1);
|
||||
return outstring.slice(0, outstring.length - 1);
|
||||
*/
|
||||
return cookie_data.cookie;
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ class WTVDownloadList {
|
||||
this.download_list += `file-permission: ${file_permission}\n`;
|
||||
if (checksum != null) this.download_list += `wtv-checksum: ${checksum}\n`;
|
||||
if (uncompressed_size != null) this.download_list += `wtv-uncompressed-filesize: ${uncompressed_size}\n`;
|
||||
this.download_list += `service-source-location: /webtv/content/${source.substring(source.indexOf('-') + 1, source.indexOf(':/'))}d/${source.substring(source.indexOf(':/') + 2)}\n`;
|
||||
this.download_list += `service-source-location: /webtv/content/${source.slice(source.indexOf('-') + 1, source.indexOf(':/'))}d/${source.slice(source.indexOf(':/') + 2)}\n`;
|
||||
this.download_list += `client-dest-location: ${path}\n\n`;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ class WTVDownloadList {
|
||||
if (typeof post_data == 'string') post_data = post_data.split("\n\n");
|
||||
const group_data = [];
|
||||
post_data.forEach(function (v) {
|
||||
if (v.substring(0, 4) == "file") {
|
||||
if (v.slice(0, 4) == "file") {
|
||||
const block_split = v.split("\n");
|
||||
const group_data_entry = {};
|
||||
group_data_entry.path = block_split[0];
|
||||
|
||||
@@ -103,7 +103,7 @@ class WTVFlashrom {
|
||||
|
||||
if (this.minisrv_config.config.debug_flags.debug && this.minisrv_config.config.debug_flags.quiet) console.log(" # Sending", (flashrom_info.is_last_part) ? "Last Flashrom" : "Flashrom", "Part", flashrom_info.part_number, "- Bytes Sent:", flashrom_info.byte_progress + flashrom_info.part_total_size, "of", flashrom_info.total_parts_size, "(" + flashrom_info.percent_complete + " % complete)");
|
||||
// read current part display message from part header
|
||||
flashrom_info.message = new Buffer.from(part_header.toString('hex').substring(36 * 2, 68 * 2), 'hex').toString('ascii').replace(/[^0-9a-z\ \.\-]/gi, "");
|
||||
flashrom_info.message = new Buffer.from(part_header.toString('hex').slice(36 * 2, 68 * 2), 'hex').toString('ascii').replace(/[^0-9a-z\ \.\-]/gi, "");
|
||||
flashrom_info.rompath = `wtv-flashrom:/${path}`;
|
||||
|
||||
if (flashrom_info.is_last_part && this.bf0app_update) {
|
||||
|
||||
@@ -70,28 +70,28 @@ class WTVGuide {
|
||||
var start = start + search.length;
|
||||
original_start = start;
|
||||
// handle <word="whatever">
|
||||
if (definition.substr(start, 1) != ">") {
|
||||
if (definition.slice(start, 1) != ">") {
|
||||
start++; // +1 to skip =
|
||||
end = definition.indexOf(">", start);
|
||||
link_word_override = definition.substring(start, end);
|
||||
link_word_override = definition.slice(start, end);
|
||||
// strip any quotes
|
||||
if (link_word_override.substr(0, 1).match(/[\"\']/)) link_word_override = link_word_override.substring(1);
|
||||
if (link_word_override.substr(link_word_override.length - 1, 1).match(/[\"\']/)) link_word_override = link_word_override.substr(0, link_word_override.length - 1);
|
||||
if (link_word_override.slice(0, 1).match(/[\"\']/)) link_word_override = link_word_override.slice(1);
|
||||
if (link_word_override.slice(link_word_override.length - 1, 1).match(/[\"\']/)) link_word_override = link_word_override.slice(0, link_word_override.length - 1);
|
||||
|
||||
link_word_for_link = link_word_override.replace(/ /g, '').replace(/\'/g, '').replace(/\"/g, '').toLowerCase();
|
||||
link_word_start_letter = link_word_for_link.substr(0, 1).toUpperCase();
|
||||
link_word_start_letter = link_word_for_link.slice(0, 1).toUpperCase();
|
||||
start = end + 1; // update start pos for rest of processing
|
||||
} else {
|
||||
start++;
|
||||
}
|
||||
end = definition.indexOf("</word>", start);
|
||||
var link_word = definition.substring(start, end);
|
||||
var link_word = definition.slice(start, end);
|
||||
if (!link_word_for_link) link_word_for_link = link_word.replace(/ /g, '').replace(/\'/g,'').replace(/\"/g,'').toLowerCase();
|
||||
if (!link_word_start_letter) link_word_start_letter = link_word.substr(0, 1).toUpperCase();
|
||||
if (!link_word_start_letter) link_word_start_letter = link_word.slice(0, 1).toUpperCase();
|
||||
if (!link_word_override) link_word_override = link_word;
|
||||
|
||||
var link_url = `wtv-guide:/help?topic=Glossary&subtopic=${link_word_start_letter}&page=${link_word_for_link}&word=${encodeURIComponent(link_word_override)}`
|
||||
var new_definition = definition.substring(0, original_start - search.length) + `<a href="${link_url}">${link_word}</a>` + definition.substring(end + 7);
|
||||
var new_definition = definition.slice(0, original_start - search.length) + `<a href="${link_url}">${link_word}</a>` + definition.slice(end + 7);
|
||||
definition = new_definition;
|
||||
}
|
||||
// replaces <boxname> with the friendly name of the type of unit the user has
|
||||
|
||||
@@ -328,7 +328,7 @@ class WTVMail {
|
||||
else return a.time - b.time;
|
||||
})
|
||||
.map(function (v) {
|
||||
if (v.name.substring((v.name.length - self.msgFileExt.length)) === self.msgFileExt) return v.name.substring(0, (v.name.length - 5));
|
||||
if (v.name.slice((v.name.length - self.msgFileExt.length)) === self.msgFileExt) return v.name.slice(0, (v.name.length - 5));
|
||||
});
|
||||
|
||||
if (files.length == 0) return false; // no messages
|
||||
@@ -398,7 +398,7 @@ class WTVMail {
|
||||
var path_after_replace = search_dir.replace(accounts_dir, '');
|
||||
// Remove leading path separator if present
|
||||
if (path_after_replace.startsWith(self.path.sep)) {
|
||||
path_after_replace = path_after_replace.substring(1);
|
||||
path_after_replace = path_after_replace.slice(1);
|
||||
}
|
||||
var path_split = path_after_replace.split(self.path.sep);
|
||||
// The path should be like "ssid/user0", so extract ssid and user_id
|
||||
|
||||
@@ -292,7 +292,7 @@ class WTVMinifyingProxy {
|
||||
for (const [selector, styles] of cssRules) {
|
||||
if (selector.startsWith('.')) {
|
||||
// Handle class selectors (e.g., .lst)
|
||||
const className = selector.substring(1);
|
||||
const className = selector.slice(1);
|
||||
const regex = new RegExp(`<(input[^>]*class\\s*=\\s*["'][^"']*\\b${className}\\b[^"']*["'][^>]*)>`, 'gi');
|
||||
html = html.replace(regex, (match, tagContent) => {
|
||||
// Convert CSS styles to attributes for this element (input tag)
|
||||
@@ -545,7 +545,7 @@ class WTVMinifyingProxy {
|
||||
// No body tag found, extract everything after head or use all content
|
||||
const headEndMatch = html.match(/<\/head>/i);
|
||||
if (headEndMatch) {
|
||||
bodyContent = html.substring(html.indexOf(headEndMatch[0]) + headEndMatch[0].length);
|
||||
bodyContent = html.slice(html.indexOf(headEndMatch[0]) + headEndMatch[0].length);
|
||||
} else {
|
||||
bodyContent = html;
|
||||
}
|
||||
@@ -711,19 +711,19 @@ ${bodyContent}
|
||||
intelligentTruncate(content, maxLength) {
|
||||
if (content.length <= maxLength) return content;
|
||||
|
||||
let truncated = content.substring(0, maxLength);
|
||||
let truncated = content.slice(0, maxLength);
|
||||
|
||||
// Try to cut at a tag boundary
|
||||
const lastCloseTag = truncated.lastIndexOf('>');
|
||||
const lastOpenTag = truncated.lastIndexOf('<');
|
||||
|
||||
if (lastCloseTag > lastOpenTag) {
|
||||
truncated = truncated.substring(0, lastCloseTag + 1);
|
||||
truncated = truncated.slice(0, lastCloseTag + 1);
|
||||
} else {
|
||||
// Cut at word boundary
|
||||
const lastSpace = truncated.lastIndexOf(' ');
|
||||
if (lastSpace > maxLength * 0.8) { // Only if we don't lose too much
|
||||
truncated = truncated.substring(0, lastSpace);
|
||||
truncated = truncated.slice(0, lastSpace);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -769,7 +769,7 @@ ${bodyContent}
|
||||
// No body tag found, extract content after head or use transformed content
|
||||
const headEndMatch = transformed.match(/<\/head>/i);
|
||||
if (headEndMatch) {
|
||||
bodyContent = transformed.substring(transformed.indexOf(headEndMatch[0]) + headEndMatch[0].length);
|
||||
bodyContent = transformed.slice(transformed.indexOf(headEndMatch[0]) + headEndMatch[0].length);
|
||||
} else {
|
||||
bodyContent = transformed;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ class WTVNewsServer {
|
||||
Object.keys(message.headers).forEach((k) => {
|
||||
if (k.length > 0) out += `${k}: ${message.headers[k]}\r\n`;
|
||||
});
|
||||
out = out.substr(0, out.length - 2);
|
||||
out = out.slice(0, out.length - 2);
|
||||
return out;
|
||||
},
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ class WTVTellyScriptTokenizer {
|
||||
// Process as a constant.
|
||||
let hexString = "";
|
||||
if (checkSequence.startsWith("0x") || checkSequence.startsWith("0X")) {
|
||||
hexString = checkSequence.substring(2);
|
||||
hexString = checkSequence.slice(2);
|
||||
} else {
|
||||
hexString = parseInt(checkSequence, 10).toString(16).toUpperCase();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user