-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] isHash should validate algorithm name #2295
Comments
Let's put this behind a new option for backwards compatibility. Some projects might use both for user input and then they expect a boolean returned instead of an error. So isHash would get an option bag which consists of |
Can you please add an enhancement label to this issue and assign it to me? |
so, if validateAlgorithm is set to true, should the function throw an error saying "Invalid algorithm" and return false? |
If it's set to true it should throw an Error, if it's set to false it will return false (the current behaviour) |
@WikiRik
I suggest having validation on the parameter algorithm in the isHash function.
The behavior below is not appropriate. The user of validator.js should get a proper error message. [Good for debugging]
Should I raise a pull request? It can be an enhancement.
The text was updated successfully, but these errors were encountered: