lib/tlv.js
function getTagLength(tag) {
  var lenTag = 4;
  
  while(lenTag > 1) {
    var tmpTag = tag >>> ((lenTag - 1) * 8);
    
    if ((tmpTag & 0xFF) != 0x00) {
      break;
    } 
    
    lenTag--;
  }
  
  return lenTag;
}
function getTagLength(tag) {
  var lenTag = 4;
  
  while(lenTag > 1) {
    var tmpTag = tag >>> ((lenTag - 1) * 8);
    
    if ((tmpTag & 0xFF) != 0x00) {
      break;
    } 
    
    lenTag--;
  }
  
  return lenTag;
}
function getTagLength ( tag ) { var lenTag = 4 ; while ( lenTag > 1 ) { var tmpTag = tag >>> ( ( lenTag - 1 ) * 8 ) ; if ( ( tmpTag & 0xFF ) != 0x00 ) { break ; } lenTag -- ; } return lenTag ; }
Returns the byte length of the given tag.

@param {number} tag
@return {number}
Returns the byte length of the given tag .