"Next to the film exit lip is an
Interleaved 2 of 5 barcode and a printed number. The 6 digits represent the I3A assigned
DX number (middle 4 digits), the number of exposures (last digit) and a proprietary manufacturer's code (first digit). The DX number identifies the manufacturer, film type, and by inference, the necessary developing process type. This is used by automatic photo-finishing machines to correctly process the exposed film."
"The outside of film cartridges are marked with a
DX Camera Auto Sensing (CAS) code readable by many cameras. Cameras can then automatically determine the
film speed, number of exposures and exposure tolerance.
"The DX Camera Auto Sensing code takes the form of a grid of contact points on the side of the metal cartridge surface that are either conductive or non-conductive. Electrical contacts in the camera read the bit pattern. Most cameras read only part of the code; typically, only the film speed is read, and some cameras aimed at the consumer market only read enough bits to tell apart the most common film speeds. For example, 100, 200, 400, and 800 can be detected by reading only S1 and S2 and ground."
"On 35mm film cartridges there are two rows of six rectangular areas. The two left-most areas (with the spool post on the left) are both common (ground) and are thus always bare metal. The remaining five bits in the top row represent 32 possible film speeds. But only the 24 speeds representing the 1/3
stops from ISO 25/15° to 5000/38° are used.
The codes are not in strict binary order.
In the second row, the first three bits represent eight possible film lengths, although in practice only 12, 20, 24 and 36 exposures are encoded. The remaining two bits of the second row give four ranges of exposure tolerance, or latitude.
Most cameras read the film speed only (first row)."
This article is the source of the above, and explains more, with illustrations of the codes.