Skip to content

Commit

Permalink
fix(readme): updated to reflect new default hashAlgo
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Mar 2, 2017
1 parent c094d9f commit c60a2fa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ cache.get(cachePath, 'my-thing').then(console.log)
thingName: 'my'
},
digest: 'deadbeef',
hashAlgorithm: 'sha256'
hashAlgorithm: 'sha512'
data: Buffer#<deadbeef>
}

// Look up by digest
cache.get.byDigest(cachePath, 'deadbeef', {
hashAlgorithm: 'sha256'
hashAlgorithm: 'sha512'
}).then(console.log)
// Output:
Buffer#<deadbeef>
Expand Down Expand Up @@ -193,12 +193,12 @@ cache.get.stream(
)
// Outputs:
metadata: { ... }
hashAlgorithm: 'sha256'
hashAlgorithm: 'sha512'
digest: deadbeef

// Look up by digest
cache.get.stream.byDigest(
cachePath, 'deadbeef', { hashAlgorithm: 'sha256' }
cachePath, 'deadbeef', { hashAlgorithm: 'sha512' }
).pipe(
fs.createWriteStream('./x.tgz')
)
Expand Down Expand Up @@ -301,7 +301,7 @@ To control the hashing algorithm, use `opts.hashAlgorithm`.

##### `hashAlgorithm`

Default: 'sha256'
Default: 'sha512'

Hashing algorithm to use when calculating the digest for inserted data. Can use
any algorithm listed in `crypto.getHashes()` or `'omakase'`/`'お任せします'` to
Expand Down Expand Up @@ -397,7 +397,7 @@ reading/writing on the cache.

* `opts.uid` - uid to assign to cache and its contents
* `opts.gid` - gid to assign to cache and its contents
* `opts.hashAlgorithm` - defaults to `'sha256'`. Hash to use for content checks.
* `opts.hashAlgorithm` - defaults to `'sha512'`. Hash to use for content checks.


##### Example
Expand Down

0 comments on commit c60a2fa

Please sign in to comment.