I wrote this some time ago for my own projects. It's reasonably fast: 
https://gist.github.com/dpo/11000433

Reply via email to