passcmp and getHashByUser functions