Clarify that chunker sizes are in bytes
Clarify that the Rabin fingerprint chunker is in bytes, and recommend using larger chunk sizes than shown in the provided examples. People are getting confused over chunker sizes and incorrectly assuming they're in kiB and not bytes. License: MIT Signed-off-by: Daniel Aleksandersen <code@daniel.priv.no>
Daniel Aleksandersen committed
Jan 13, 2019 at 05:05 UTC
745f82e0f994ea045ed54f20cfc6d0e107ffd721
1 file changed
+9
-5
core/commands/add.go
+9
-5
@@ -78,12 +78,16 @@ You can now refer to the added file in a gateway, like so:
78
79
The chunker option, '-s', specifies the chunking strategy that dictates
80
how to break files into blocks. Blocks with same content can
81
-be deduplicated. The default is a fixed block size of
81
+be deduplicated. Different chunking strategies will produce different
82
+hashes for the same file. The default is a fixed block size of
83
256 * 1024 bytes, 'size-262144'. Alternatively, you can use the
83
-rabin chunker for content defined chunking by specifying
84
-rabin-[min]-[avg]-[max] (where min/avg/max refer to the resulting
85
-chunk sizes). Using other chunking strategies will produce
86
-different hashes for the same file.
84
+Rabin fingerprint chunker for content defined chunking by specifying
85
+rabin-[min]-[avg]-[max] (where min/avg/max refer to the desired
86
+chunk sizes in bytes), e.g. 'rabin-262144-524288-1048576'.
87
+
88
+The following examples use very small byte sizes to demonstrate the
89
+properties of the different chunkers on a small file. You'll likely
90
+want to use a 1024 times larger chunk sizes for most files.
91
92
> ipfs add --chunker=size-2048 ipfs-logo.svg
93
added QmafrLBfzRLV4XSH1XcaMMeaXEUhDJjmtDfsYU95TrWG87 ipfs-logo.svg