How to convert binary to hex in Node.js

1 Answer

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

 



answered Dec 28, 2021 by avibootz

Related questions

1 answer 128 views
1 answer 206 views
1 answer 89 views
1 answer 91 views
1 answer 108 views
1 answer 101 views
101 views asked Nov 18, 2024 by avibootz
...