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 229 views
1 answer 321 views
1 answer 201 views
1 answer 184 views
1 answer 207 views
1 answer 192 views
192 views asked Nov 18, 2024 by avibootz
...