UNPKG

obd-raw-data-parser

Version:

A React Native hook library to manage Bluetooth Low Energy connections and communication with ELM327 OBD-II adapters.

2 lines 437 B
Object.defineProperty(exports,"__esModule",{value:true});exports.Hex2Bin=Hex2Bin;exports.checkHex=checkHex;function checkHex(n){return /^[0-9A-Fa-f]{1,64}$/.test(n);}function Hex2Bin(n){if(!checkHex(n)){return'';}var binary=parseInt(n,16).toString(2);return zeroFill(binary.slice(-4),4);}function zeroFill(number,width){width-=number.length;if(width>0){return'0'.repeat(width)+number;}return number;} //# sourceMappingURL=obdUtils.js.map