For Components and for Modules I know we can get the active ID of an extension using JComponentHelper::getComponent("com_") and JModuleHelper::getModule("mod_").
However I want to be able to obtain the extension ID of lets say a package type. Is there a function in the current CMS libraries (preferable that will work in both 3.3 and 2.5) that will give me this result. After preliminary search of JInstaller and JInstallAdapter classes I have not found anything immediately useful. Otherwise I believe option 2 is to do a manual DB query to retrieve the desired ID, which I rather avoid if possible if Joomla is already providing such functionality.