fixed  password hashing and added salt generator function