Skip to content

Unexpected behavior of StringUtils Hash action #175

Description

@MatthijsDB

The results of calling the StringUtils Hash action are unexpected, partly because it's poorly documented.

In my case, when I used this action with any value (String with a length of a 100 characters) and a length of 64. it returned a String with a length of 128 characters of which the last 64 were all zeros. When calling it with a length of 32, it returned a String of 64 characters. When calling it with a length of less than 32, an error occurred, saying the length should be at least 32. The function of the length parameter is very confusing.

The documentation of the action itself says:

Hashes a value using the SHA-256 hash algorithm. 
- value : the value to hash
- length : the desired length of the hash. 
Returns a SHA-256 hash of 'value', with length 'length'

The official documentation doesn't add any detail to that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions