An enzyme, dihydrogen:acceptor oxidoreductase, that catalyzes the formation or oxidation of H2. Hydrogenases are of various types. One class ([Fe]-hydrogenases) contains only iron-sulfur clusters. The other major class ([NiFe]-hydrogenases) has a nickel-containing center and iron-sulfur clusters; a variation of the latter type ([NiFeSe]-hydrogenases) contains selenocysteine.