Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 2904a7e

Browse files
aleybovichalanshaw
authored andcommitted
docs: Added a list of all possible hash algorithms and default hash function (#357)
* Added a link to the list of possible values for hash/hashAlg * Added the link to the list of all possible hash functions as well as the default hash algorithm
1 parent 2b1332b commit 2904a7e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

SPEC/FILES.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ If no `content` is passed, then the path is treated as an empty directory
156156
- 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)
157157
- progress (function): a function that will be called with the byte length of chunks as a file is added to ipfs.
158158
- recursive (boolean): for when a Path is passed, this option can be enabled to add recursively all the files.
159-
- hashAlg || hash (string): multihash hashing algorithm to use.
159+
- 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)
160160
- wrapWithDirectory (boolean): adds a wrapping node around the content.
161161
- onlyHash (boolean): doesn't actually add the file to IPFS, but rather calculates its hash.
162162
- 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
217217

218218
- 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)
219219
- progress (function): a function that will be called with the byte length of chunks as a file is added to ipfs.
220-
- hashAlg || hash (string): multihash hashing algorithm to use
220+
- 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)
221221
- wrapWithDirectory (boolean): adds a wrapping node around the content
222222
- pin (boolean, default true): pin this object when adding.
223223

@@ -267,7 +267,7 @@ Returns a Pull Stream, where objects can be written of the forms
267267

268268
- 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)
269269
- progress (function): a function that will be called with the byte length of chunks as a file is added to ipfs.
270-
- hashAlg || hash (string): multihash hashing algorithm to use
270+
- 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)
271271
- wrapWithDirectory (boolean): adds a wrapping node around the content
272272
- pin (boolean, default true): pin this object when adding.
273273

@@ -618,7 +618,7 @@ Where:
618618
- `options` is an optional Object that might contain the following keys:
619619
- `parents` is a Boolean value to decide whether or not to make the parent directories if they don't exist (default: false)
620620
- `format` is what type of nodes to write any newly created directories as (default: `dag-pb`)
621-
- `hashAlg` is which algorithm to use when creating CIDs for newly created directories (default: `sha2-256`)
621+
- `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)
622622
- `flush` is a Boolean value to decide whether or not to immediately flush MFS changes to disk (default: true)
623623
- `callback` is an optional function with the signature `function (error) {}`, where `error` may be an Error that occured if the operation was not successful
624624

@@ -671,7 +671,7 @@ Where:
671671
- `options` is an optional Object that might contain the following keys:
672672
- `parents` is a Boolean value to decide whether or not to make the parent directories if they don't exist (default: false)
673673
- `format` is what type of nodes to write any newly created directories as (default: `dag-pb`)
674-
- `hashAlg` is which algorithm to use when creating CIDs for newly created directories (default: `sha2-256`)
674+
- `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)
675675
- `flush` is a Boolean value to decide whether or not to immediately flush MFS changes to disk (default: true)
676676
- `callback` is an optional function with the signature `function (error) {}`, where `error` may be an Error that occured if the operation was not successful
677677

@@ -911,7 +911,7 @@ Where:
911911
- `options` is an optional Object that might contain the following keys:
912912
- `parents` is a Boolean value to decide whether or not to make the parent directories if they don't exist (default: false)
913913
- `format` is what type of nodes to write any newly created directories as (default: `dag-pb`)
914-
- `hashAlg` is which algorithm to use when creating CIDs for newly created directories (default: `sha2-256`)
914+
- `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)
915915
- `flush` is a Boolean value to decide whether or not to immediately flush MFS changes to disk (default: true)
916916
- `callback` is an optional function with the signature `function (error) {}`, where `error` may be an Error that occured if the operation was not successful
917917

0 commit comments

Comments
 (0)