LoginAPI, helper method for hashing