In the answer from this question Determine if private key belongs to certificate?
The proposed solution is to match a private key and a certificate by extracting and matching the public key of both.
While in this page: https://www.sslshopper.com/certificate-key-matcher.html
The proposed solution is to extract the modulus of the public key, apply a MD5 hash to it and then compare the hashes.
Is there any difference in both approaches ? Would the second approach be the same if I compare only the modulus of the public key and not the MD5 hash ?