From ba27a847b9bf5dd7715471b26dcfb30e3b441d3f Mon Sep 17 00:00:00 2001 From: Sam Chen Date: Sat, 21 Sep 2024 11:14:31 +0800 Subject: [PATCH 1/3] docs(api): document hashDigest etc. --- src/content/api/loaders.mdx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/content/api/loaders.mdx b/src/content/api/loaders.mdx index c26696d357cf..4da0db8b8640 100644 --- a/src/content/api/loaders.mdx +++ b/src/content/api/loaders.mdx @@ -389,6 +389,30 @@ module.exports = function (source) { }; ``` +### this.hashDigest + +`string` + +The algorithm used for the hash. + +### this.hashDigestLength + +`number` + +The length of the hash. + +### this.hashFunction + +`string` + +The hash function used. + +### this.hashSalt + +`string` + +The salt used for the hash. + ### this.importModule From af202e7889d0fe749e65c4f008516986f5344217 Mon Sep 17 00:00:00 2001 From: Sam Chen Date: Sat, 21 Sep 2024 11:21:17 +0800 Subject: [PATCH 2/3] add links --- src/content/api/loaders.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/content/api/loaders.mdx b/src/content/api/loaders.mdx index 4da0db8b8640..8346f0a391f6 100644 --- a/src/content/api/loaders.mdx +++ b/src/content/api/loaders.mdx @@ -393,25 +393,25 @@ module.exports = function (source) { `string` -The algorithm used for the hash. +The encoding to use when generating the hash. See [output.hashDigest](/configuration/output/#outputhashdigest). ### this.hashDigestLength `number` -The length of the hash. +The prefix length of the hash digest to use. See [output.hashDigestLength](/configuration/output/#outputhashdigestlength). ### this.hashFunction -`string` +`string` `function` -The hash function used. +The hashing algorithm to use. See [output.hashFunction](/configuration/output/#outputhashfunction). ### this.hashSalt `string` -The salt used for the hash. +An optional salt to update the hash via Node.JS' [`hash.update`](https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding). See [output.hashSalt](/configuration/output/#outputhashsalt). ### this.importModule From 23a749714c6042c84bc458c5d6e55b2691f41edd Mon Sep 17 00:00:00 2001 From: Sam Chen Date: Thu, 26 Sep 2024 07:35:08 +0800 Subject: [PATCH 3/3] add badge --- src/content/api/loaders.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/content/api/loaders.mdx b/src/content/api/loaders.mdx index 8346f0a391f6..64b14b542e0c 100644 --- a/src/content/api/loaders.mdx +++ b/src/content/api/loaders.mdx @@ -393,24 +393,32 @@ module.exports = function (source) { `string` + + The encoding to use when generating the hash. See [output.hashDigest](/configuration/output/#outputhashdigest). ### this.hashDigestLength `number` + + The prefix length of the hash digest to use. See [output.hashDigestLength](/configuration/output/#outputhashdigestlength). ### this.hashFunction `string` `function` + + The hashing algorithm to use. See [output.hashFunction](/configuration/output/#outputhashfunction). ### this.hashSalt `string` + + An optional salt to update the hash via Node.JS' [`hash.update`](https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding). See [output.hashSalt](/configuration/output/#outputhashsalt). ### this.importModule