removing hex2bin to avoid having to add code for this in JS and to not introduce a dependency on paste IDs always having to be hex strings

This commit is contained in:
El RIDO
2019-06-29 11:24:25 +02:00
parent 5651c0f04e
commit 74519f6c4f
6 changed files with 7 additions and 26 deletions

View File

@@ -664,23 +664,6 @@ jQuery.PrivateBin = (function($, RawDeflate) {
*/
let base58 = new baseX('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz');
/**
* convert hexadecimal string to binary representation
*
* @name CryptTool.hex2bin
* @function
* @private
* @param {string} message hex string
* @return {string} binary representation as a DOMString
*/
function hex2bin(message) {
let result = [];
for (let i = 0, l = message.length; i < l; i += 2) {
result.push(parseInt(message.substr(i, 2), 16));
}
return String.fromCharCode.apply(String, result);
}
/**
* convert UTF-8 string stored in a DOMString to a standard UTF-16 DOMString
*
@@ -1014,9 +997,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
false, // may not export this
['sign']
),
stringToArraybuffer(
hex2bin(id)
)
stringToArraybuffer(id)
)
)
);