From cd6d2db104b2454e02b1c74ef77bb732e6359193 Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 28 Aug 2018 16:18:18 +0300 Subject: [PATCH 1/2] Added a link to the list of possible values for hash/hashAlg --- SPEC/FILES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPEC/FILES.md b/SPEC/FILES.md index ad361e32e..80fb1bc0f 100644 --- a/SPEC/FILES.md +++ b/SPEC/FILES.md @@ -156,7 +156,7 @@ If no `content` is passed, then the path is treated as an empty directory - cid-version (integer, default 0): the CID version to use when storing the data (storage keys are based on the CID, including it's version) - progress (function): a function that will be called with the byte length of chunks as a file is added to ipfs. - recursive (boolean): for when a Path is passed, this option can be enabled to add recursively all the files. -- hashAlg || hash (string): multihash hashing algorithm to use. +- hashAlg || hash (string): multihash hashing algorithm to use. [The list of all possible values]( https://github.com/multiformats/js-multihash/blob/master/src/constants.js#L5-L343) - wrapWithDirectory (boolean): adds a wrapping node around the content. - onlyHash (boolean): doesn't actually add the file to IPFS, but rather calculates its hash. - pin (boolean, default true): pin this object when adding. From 9e3c86b90cadae89d60277b7d5d39d10771e6d48 Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 28 Aug 2018 16:21:30 +0300 Subject: [PATCH 2/2] Added the link to the list of all possible hash functions as well as the default hash algorithm --- SPEC/FILES.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SPEC/FILES.md b/SPEC/FILES.md index 80fb1bc0f..e5da93d70 100644 --- a/SPEC/FILES.md +++ b/SPEC/FILES.md @@ -156,7 +156,7 @@ If no `content` is passed, then the path is treated as an empty directory - cid-version (integer, default 0): the CID version to use when storing the data (storage keys are based on the CID, including it's version) - progress (function): a function that will be called with the byte length of chunks as a file is added to ipfs. - recursive (boolean): for when a Path is passed, this option can be enabled to add recursively all the files. -- hashAlg || hash (string): multihash hashing algorithm to use. [The list of all possible values]( https://github.com/multiformats/js-multihash/blob/master/src/constants.js#L5-L343) +- hashAlg || hash (string): multihash hashing algorithm to use. (default: `sha2-256`) [The list of all possible values]( https://github.com/multiformats/js-multihash/blob/master/src/constants.js#L5-L343) - wrapWithDirectory (boolean): adds a wrapping node around the content. - onlyHash (boolean): doesn't actually add the file to IPFS, but rather calculates its hash. - pin (boolean, default true): pin this object when adding. @@ -217,7 +217,7 @@ Returns a Readable Stream of class Duplex, where objects can be written of the f - cid-version (integer, default 0): the CID version to use when storing the data (storage keys are based on the CID, including it's version) - progress (function): a function that will be called with the byte length of chunks as a file is added to ipfs. -- hashAlg || hash (string): multihash hashing algorithm to use +- hashAlg || hash (string): multihash hashing algorithm to use. (default: `sha2-256`) [The list of all possible values]( https://github.com/multiformats/js-multihash/blob/master/src/constants.js#L5-L343) - wrapWithDirectory (boolean): adds a wrapping node around the content - pin (boolean, default true): pin this object when adding. @@ -267,7 +267,7 @@ Returns a Pull Stream, where objects can be written of the forms - cid-version (integer, default 0): the CID version to use when storing the data (storage keys are based on the CID, including it's version) - progress (function): a function that will be called with the byte length of chunks as a file is added to ipfs. -- hashAlg || hash (string): multihash hashing algorithm to use +- hashAlg || hash (string): multihash hashing algorithm to use. (default: `sha2-256`) [The list of all possible values]( https://github.com/multiformats/js-multihash/blob/master/src/constants.js#L5-L343) - wrapWithDirectory (boolean): adds a wrapping node around the content - pin (boolean, default true): pin this object when adding. @@ -618,7 +618,7 @@ Where: - `options` is an optional Object that might contain the following keys: - `parents` is a Boolean value to decide whether or not to make the parent directories if they don't exist (default: false) - `format` is what type of nodes to write any newly created directories as (default: `dag-pb`) - - `hashAlg` is which algorithm to use when creating CIDs for newly created directories (default: `sha2-256`) + - `hashAlg` is which algorithm to use when creating CIDs for newly created directories. (default: `sha2-256`) [The list of all possible values]( https://github.com/multiformats/js-multihash/blob/master/src/constants.js#L5-L343) - `flush` is a Boolean value to decide whether or not to immediately flush MFS changes to disk (default: true) - `callback` is an optional function with the signature `function (error) {}`, where `error` may be an Error that occured if the operation was not successful @@ -671,7 +671,7 @@ Where: - `options` is an optional Object that might contain the following keys: - `parents` is a Boolean value to decide whether or not to make the parent directories if they don't exist (default: false) - `format` is what type of nodes to write any newly created directories as (default: `dag-pb`) - - `hashAlg` is which algorithm to use when creating CIDs for newly created directories (default: `sha2-256`) + - `hashAlg` is which algorithm to use when creating CIDs for newly created directories (default: `sha2-256`) [The list of all possible values]( https://github.com/multiformats/js-multihash/blob/master/src/constants.js#L5-L343) - `flush` is a Boolean value to decide whether or not to immediately flush MFS changes to disk (default: true) - `callback` is an optional function with the signature `function (error) {}`, where `error` may be an Error that occured if the operation was not successful @@ -911,7 +911,7 @@ Where: - `options` is an optional Object that might contain the following keys: - `parents` is a Boolean value to decide whether or not to make the parent directories if they don't exist (default: false) - `format` is what type of nodes to write any newly created directories as (default: `dag-pb`) - - `hashAlg` is which algorithm to use when creating CIDs for newly created directories (default: `sha2-256`) + - `hashAlg` is which algorithm to use when creating CIDs for newly created directories (default: `sha2-256`) [The list of all possible values]( https://github.com/multiformats/js-multihash/blob/master/src/constants.js#L5-L343) - `flush` is a Boolean value to decide whether or not to immediately flush MFS changes to disk (default: true) - `callback` is an optional function with the signature `function (error) {}`, where `error` may be an Error that occured if the operation was not successful