SHARE
TWEET

Untitled




Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- function Hex32BitToBinary(HexData){
- let result = "";
- //32bit hex to string
- HexData.match(/.{1,2}/g).forEach(str => {
- result += hex2bin(str)
- });
- return result;
- }
- //Function to convert hex string to binary
- function hex2bin(hex) {
- let regEx = /^[0-9]*$/g;
- let binary = ("00000000" + (parseInt(hex, 16)).toString(2)).substr(-8);
- if (regEx.test(binary)) {
- return binary;
- } else {
- return null;
- }
- };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.