Suppose I hashed a password and obtained a hashcode for it. I need to find the degree of similarity between the password and its hashcode. Please suggest me some different mechanism for this
This is impossible.  That's the entire point of secure hash algorithms that are used, among other things, to hash passwords.
Anybody know a valid mechanism to detect the degree of similarity between a string and its hashcode?