added variable and input paramete for hash length