This paper presents an algorithm for calculation of the Lyubeznik numbers of a local ring which is a homomorphic image of a regular local ring R of prime characteristic. The methods used employ Lyubeznik's F-modules over R, particularly his F-finite F-modules, and also the modules of generalized fractions of Sharp and Zakeri. It is shown that many modules of generalized fractions over R have natural structures as F-modules; these lead to F-module structures on certain local cohomology modules over R, which are exploited, in conjunction with F-module structures on injective R-modules that result from work of Huneke and Sharp, to compute Lyubeznik numbers. The resulting algorithm has been implemented in Macaulay2