What is the applypatch tool and how does one use it? I recently stumbled upon the applypatch tool, but I couldn't find any documentation for it online. Here is the usage output (this is after typing adb shell)

shell@android:/ $ applypatch --help                                            
usage: applypatch [-b &lt;bonus-file&gt;] &lt;src-file&gt; &lt;tgt-file&gt; &lt;tgt-sha1&gt; &lt;tgt-size&gt; [&lt;src-sha1&gt;:&lt;patch&gt; ...]
   or  applypatch -c &lt;file&gt; [&lt;sha1&gt; ...]
   or  applypatch -s &lt;bytes&gt;
   or  applypatch -l

Filenames may be of the form
  MTD:&lt;partition&gt;:&lt;len_1&gt;:&lt;sha1_1&gt;:&lt;len_2&gt;:&lt;sha1_2&gt;:...
to specify reading from or writing to an MTD partition.


What do the command line options mean? What is MTD? What are all the sha1 hashes for?

Also, could someone with the reputation add an applypatch tag, or maybe a tools tag? Something more descriptive than what I've put.
diff and patch are Unix/Linux commands used to easily check for differences, send updates to huge files by shipping only the differences, etc. (see Wikipedia). They are mostly used in development (to update source code), but can also serve practical purposes in non-development environments.

applypatch is one of those patch-tools on Android, and used e.g. for minor updates (OTA and the like). So it is most likely not intended for the "normal end user" to deal with it directly.