shared code - making pw hash