let b = 11010;
let hex = parseInt(b, 2).toString(16).toUpperCase();
console.log(hex);
hex = hex.padStart(4, "0")
console.log(hex);
b = 1001101011;
hex = parseInt(b, 2).toString(16).toUpperCase();
console.log(hex);
hex = hex.padStart(4, "0")
console.log(hex);
/*
run:
1A
001A
26B
026B
*/