src/lib/hex.js
function fromString(str) {
  const bytes = [];

  for (let n = 0, l = str.length; n < l; n++) {
    const hex = Number(str.charCodeAt(n)).toString(16);
    bytes.push(hex);
  }

  return '0x' + bytes.join('');
}
function fromString(str) {
  const bytes = [];

  for (let n = 0, l = str.length; n < l; n++) {
    const hex = Number(str.charCodeAt(n)).toString(16);
    bytes.push(hex);
  }

  return '0x' + bytes.join('');
}
function fromString ( str ) { const bytes = [ ] ; for ( let n = 0 , l = str . length ; n < l ; n ++ ) { const hex = Number ( str . charCodeAt ( n ) ) . toString ( 16 ) ; bytes . push ( hex ) ; } return '0x' + bytes . join ( '' ) ; }
Convert ascii `String` to hex
@param {String} str
@return {String}
Convert ascii String to hex