Precise Measurement of Noisy Voltage
If you use a low-side shunt and have +/- supplies available, an instrumentation amplifier followed by an ADC would do the trick. You will need to filter the input so that the transients don't get through, or make ADC measurements fast enough (and without the input saturating) that you don't get significant aliasing and can filter the ADC outputs digitally. 

Alternatively, you could use a closed-loop Hall current transducer such as the LEM LTSR series. The lowest current they have is 6A, then 15A, but you could put multiple turns through the primary to get integer fractions of those full scale values (for example, four turns through the 15A gives you 3.75A full scale). 



They can be powered from your 5V supply and perhaps connected directly to a microcontroller ADC through a filter (application notes love to use Sallen-Key filters for this). 

A Hall sensor is superior for this kind of application because it provides galvanic isolation, so common mode noise won't easily find its way to your circuit. Closed-loop Hall transducers null out the field from input current by an auxiliary coil so they have good linearity. 

The shunt circuit might be cheaper, but requires more care to ensure the common mode input range of the instrumentation amplifier is not exceeded (it might be a lot less than the supply rails) and the voltage across the shunt terminals will necessarily be rather low. If you allow 50 or 100mV across the shunt at 5A, then your 20mA is only 200uV or 400uV.  

If you're just building one, I'd suggest the Hall sensor to save you time. If you're making a product that will be produced in quantity the shunt might look attractive.