I haven't actually written code for fingerprint matching, but I've studied the methods and algorithms and it's pretty complicated. There are a bunch of ways to do it, and I doubt that even if anyone has code not under a non-disclosure agreement, they won't just give it to you. If you search google for "fingerprint algorithms" then you'll get a few good hits.