We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 91818e5 + eb2a006 commit d963b26Copy full SHA for d963b26
src/tribler/ui/src/lib/utils.ts
@@ -31,11 +31,8 @@ export function capitalize(name: string) {
31
}
32
33
export function unhexlify(input: string) {
34
- var result = '';
35
- for (var i = 0, l = input.length; i < l; i += 2) {
36
- result += String.fromCharCode(parseInt(input.slice(i, i + 2), 16));
37
- }
38
- return result;
+ // Solution by SuperStormer @ https://stackoverflow.com/a/76241398
+ return new TextDecoder().decode(new Uint8Array([...input.matchAll(/[0-9a-f]{2}/g)].map(a => parseInt(a[0], 16))));
39
};
40
41
export function getFilesFromMetainfo(metainfo: string) {
0 commit comments