Dear plugin team,
What do the parameters “input_encoding” and “hash_encoding” of the “GenerateSHA1HashAction” in the string extensions plugin do?
I try to understand how they work because when I use an online sha1 generator I get different results than the with the Novulo plugin action.
If I hash the string “123” with the plugin action, get the result
QL0AFWMIX8NRZTKeof9cXsvbvu8=
When I use the online tool http://www.sha1-online.com/ however, the string “123” results in
40bd001563085fc35165329ea1ff5c5ecbdbbeef
I was wondering if maybe the parameters “input_encoding” and “hash_encoding” could help in getting the same output as the online tool.
Thanks in advance for your help!
For all generate SHAX actions, the input and hash encodings do as follows:
input_encoding - encodes all the characters of the provided base_string into the specified encoding. Here is where you would usually specify utf-8 or utf-16 (or any other supported encoding by the system). I think in the used .net framework version by us, these are the available encodings:
The hash_encoding is used to specify what encoding the output should use. The possible values here are either hex or base_64
Defaults:
- input_encoding - UTF-8
- hash_encoding - base64
To get the same result as the online tool, you need to use the following values:
- base_string - “123”
- input_encoding - “utf-8”
- hash_encoding - “hex”
With these values using an online tool i get
40bd001563085fc35165329ea1ff5c5ecbdbbeef
If i change output encoding to base64
QL0AFWMIX8NRZTKeof9cXsvbvu8=
Here is a better tool that you can use to observe the differences:
1 Like