Zynga interview question

Write program that takes string and returns a digit.