Skip to content
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

[LR][getFromGroovy] couldn't use digest method #2398

Closed
ittaLaRedoute opened this issue Jun 3, 2022 · 0 comments
Closed

[LR][getFromGroovy] couldn't use digest method #2398

ittaLaRedoute opened this issue Jun 3, 2022 · 0 comments

Comments

@ittaLaRedoute
Copy link

ittaLaRedoute commented Jun 3, 2022

Hello,
Using a getFromGroovy property, I tried to use digest method in order to hash a string using SHA-256 but I get an error message:

Groovy evaluation error: java.util.concurrent.ExecutionException: groovy.lang.MissingMethodException: No signature of method: java.lang.String.digest() is applicable for argument types: (java.lang.String) values: [SHA-256]
Possible solutions: getAt(java.lang.String), toSet(), toList(), next(), size(), size()

here is the execution on groovy console:
image

Code:
def value='string to hash'
// We can provide hash algorithm with digest method.
def sha256 = value.digest('SHA-256')

Output:
4904d96e05c2ba8ab5e28bfba3c31c2ca0ea6da94aa4245e79ee47107dbb683e

We succeeded to do the hashing with a query in a postgre database that has digest extension, but this is not a proper solution.
It would be nice if we could do this using groovy.

Can you please check if it is possible?

Let me know if you need more information.

Regards,
Hanane

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants