code: function ipv6tohex(s) {
    var msgMalformedAddress = "malformed IPv6 address";
    if (! s.match(/^[0-9A-Fa-f:]+$/))
      throw msgMalformedAddress;
  
    // 1. downcase
    s = s.toLowerCase();
  
    // 2. expand ::
    var num_colon = s.split(':').length - 1;
    if (num_colon < 2) throw msgMalformedAddress;
    var colon_replacer = ':'.repeat(7 - num_colon + 2);
    s = s.replace('::', colon_replacer);
  
    // 3. fill zero
    var a = s.split(':');
    if (a.length != 8) throw msgMalformedAddress;
    for (var i = 0; i < 8; i++) {
      a[i] = ("0000" + a[i]).slice(-4);
    }
    return a.join('');
  }
docs: ==== hex / ipv6 ================================= 
  convert any IPv6 address to a 16 byte hexadecimal string
  @function
  @param s string of IPv6 address
  @return {String} 16 byte hexadecimal string of IPv6 address
  @description
  This function converts any IPv6 address representation string
  to a 16 byte hexadecimal string of address.
  @example