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

Commit

Permalink
docs: Added a list of all possible hash algorithms and default hash f…
Browse files Browse the repository at this point in the history
…unction (#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
  • Loading branch information
aleybovich authored and alanshaw committed Aug 28, 2018
1 parent 2b1332b commit 2904a7e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions SPEC/FILES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. (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.
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 2904a7e

Please sign in to comment.