The Shack-Hartmann wavefront sensor (SHWS) recently has been extensively researched for optical surface metrology due to its extendable dynamic range compared with interferometry technique. In this paper, we proposed to use a digital SHWS to measure toroidal surfaces, which are widely used in many optical systems due to their different symmetries and curvatures in the X and Y directions. For what is believed to be the first time, an asymmetrical optical lenslet array implemented by a spatial light modulator was presented to tackle the measurement challenge. This unconventional design approach has a great advantage to provide different optical powers in the X and Y directions so that focusing spots can be formed and captured on the detector plane for accurate centroid finding and precise wavefront evaluation for 3D shape reconstruction of the toroidal surface. A digital SHWS system with this extraordinary microlens array was built to verify the design concept, and the experimental results were presented and analyzed.