code: function normalizeLength(sig) {
    let data = sig;
    let pos = 0;
    let len;
  
    if (data[pos++] !== 0x30)
      return sig;
  
    [len, pos] = getLength(data, pos);
  
    if (data.length > len + pos)
      data = data.slice(0, len + pos);
  
    if (data[pos++] !== 0x02)
      return sig;
  
    // R length.
    [len, pos] = getLength(data, pos);
  
    pos += len;
  
    if (data[pos++] !== 0x02)
      return sig;
  
    // S length.
    [len, pos] = getLength(data, pos);
  
    if (data.length > len + pos)
      data = data.slice(0, len + pos);
  
    return data;
  }
docs: /*
  Helpers