Michel wrote:
> Hello,
>
> In the different repodata files which are used by Yum a rpm package is
> mostly referenced by a checksum. My question is how is this checksum
> generated/calculated? Which pieces of information are required to
> create this checksum?
>
> A example of a checksum from one of the repodata xml files:
>
> <checksum type="sha"
> pkgid="YES">0ce988a5349489fa0c7a8c86e86bbd86e1525096</checksum>
From sha1sum man page:
The sums are computed as described in FIPS-180-1. When checking, the
input should be a former output of this program. The default mode is
to print a line with checksum, a character indicating type (`*' for
binary, ` ' for text), and name for each FILE.
An easy google search on FIPS-180-1 give the following link:
http://www.itl.nist.gov/fipspubs/fip180-1.htm
In general you need the whole file in question to generate the checksum, the
length and the data inside the file is analyzed and will then result in the
checksum. Even if you have two files of the same length, but a slight data
difference (one byte is enough), this will generate two different checksums.
I hope this is enough of an answer.
//Aho