Home Reference Source

src/utils/hex.ts

  1. /**
  2. * hex dump helper class
  3. */
  4.  
  5. const Hex = {
  6. hexDump: function (array) {
  7. let str = '';
  8. for (let i = 0; i < array.length; i++) {
  9. let h = array[i].toString(16);
  10. if (h.length < 2) {
  11. h = '0' + h;
  12. }
  13.  
  14. str += h;
  15. }
  16. return str;
  17. },
  18. };
  19.  
  20. export default Hex;