http://www.openwall.com/phpass/
It does all the work for you, and will even fall back to other algorithms if you don't have bcrypt available.