grafana / k6

A modern load testing tool, using Go and JavaScript - https://k6.io
GNU Affero General Public License v3.0
25.1k stars 1.24k forks source link

Hash module #2814

Open mwain opened 1 year ago

mwain commented 1 year ago

Feature Description

There is a crypto module providing crypto hash functions, i would like to use non crypto hashes like ones found in hash package.

Is there a desire to add an extra module to k6 providing support for non crypto hashes?

Suggested Solution (optional)

Hash module, similar to crypto

Already existing or connected issues / PRs (optional)

No response

na-- commented 1 year ago

Hmm :thinking: Can you please elaborate and explain what your use case is?

I can see how something like this would be useful, and it makes some sense to have a high-speed implementation (i.e. in Go, not in JS) of these hash functions, but there are some challenges in terms of API design we need to consider before we can add them :disappointed:

As you say, these hashes are not cryptographic, so they shouldn't be in the existing k6/crypto module or in the upcoming implementation of the WebCrypto APIs (https://github.com/grafana/xk6-webcrypto, which we plan soon merge in the k6 core, first in k6/experimental and then as a stable API).

So, yeah, I am not sure where to put them, just that a top-level k6/hash module doesn't seem like quite the right place :thinking: