1. A method for determining a threat substance encountered by a time-of-flight mass spectrometer (TOF-MS) in a test substance, using a pre-computed threat library of a plurality of threat substances, the method comprising the steps of: acquiring a spectrum of the test substance, said spectrum including a plurality of spectral peaks, each of plurality of spectral peaks having a mass/charge (m/z) value; creating a peak present spectrum from the plurality of spectral peaks, wherein a peak presence at each of a plurality of ranges of m/z values is indicated by a numeral 1 , while peak absence is indicated by a numeral 0 ; computing for each threat substance in the threat library, a likelihood value that the threat substance is present in each of the plurality of spectral peaks of the spectrum of the test substance; and identifying the threat substance with the highest likelihood value as present in the test substance.