k6/crypto
Open source
RSS
k6/crypto
Note
A module with a better and standard API exists.
The crypto module partially implements the WebCrypto API, supporting more features than k6/crypto.
The k6/crypto
module provides common hashing functionality available in the GoLang crypto package.
Function | Description |
---|---|
createHash(algorithm) | Create a Hasher object, allowing the user to add data to hash multiple times, and extract hash digests along the way. |
createHMAC(algorithm, secret) | Create an HMAC hashing object, allowing the user to add data to hash multiple times, and extract hash digests along the way. |
hmac(algorithm, secret, data, outputEncoding) | Use HMAC to sign an input string. |
md4(input, outputEncoding) | Use MD4 to hash an input string. |
md5(input, outputEncoding) | Use MD5 to hash an input string. |
randomBytes(int) | Return an array with a number of cryptographically random bytes. |
ripemd160(input, outputEncoding) | Use RIPEMD-160 to hash an input string. |
sha1(input, outputEncoding) | Use SHA-1 to hash an input string. |
sha256(input, outputEncoding) | Use SHA-256 to hash an input string. |
sha384(input, outputEncoding) | Use SHA-384 to hash an input string. |
sha512(input, outputEncoding) | Use SHA-512 to hash an input string. |
sha512_224(input, outputEncoding) | Use SHA-512/224 to hash an input string. |
sha512_256(input, outputEncoding) | Use SHA-512/256 to hash an input string. |
Class | Description |
---|---|
Hasher | Object returned by crypto.createHash(). It allows adding more data to be hashed and to extract digests along the way. |
Was this page helpful?
Related documentation
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:
16 Apr

Getting started with logging and Grafana Loki
See a demo of the updated features in Loki, and how to create metrics from logs and alert on your logs with powerful Prometheus-style alerting rules.
07 May

Loki at Dropbox: Strategies for reliable petabyte-scale logging
Engineers at Dropbox share hard-won lessons frorm scaling Grafana Loki to manage multi-petabyte unstructured logs for 1,000+ services.
08 May

7 features to get more out of Loki with Logs Drilldown in Grafana
We'll show you how to get the most out of Loki with Logs Drilldown, the queryless, point-and-click experience in Grafana that allows you to quickly find insights in your observability data - no queries or complicated syntax required.