Skip to content

Use a generic hashing abstraction across the whole project #1121

@norberttech

Description

@norberttech

Current in few places we are using hashing algorithms, like for example in Rows::hash() function.

The definition of this method looks like that:

Rows::hash(string $algorithm = 'xxh128', bool $binary = false, array $options = []) : string

Another exampole would be Flow\ETL\Function\Hash or GroupBy (that is using hashing internally)

What we should do instead is replace it with already exising abstraction Flow\ETL\Hash\Algorith which is just a simple interface in all of those places and simply pass NativePHPHash instance as a default.

So for example Rows could look like this:

- Rows::hash(string $algorithm = 'xxh128', bool $binary = false, array $options = []) : string
+ Rows::hash(Algorith $algorithm = new NativePHPHash()) : string

If any of the adapters (like for example elasticsearch) are also using some form o hashing, they should as well be converted to relay on Algorithm interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions