Perficient interview question

Q: Write a program to generate a key for a given string that should be same at each time if a given string is same. Ex; s = 'Python', key='123456' using custom logic.