Should probably be called deriveKey(), not really a hash function, but good job breaking it out to a function.