Initial checksums API.
Add basic logic of hashing.
Add encodings.
Implement the rest of pkg_checksum.
Store digest format in meta file.
Reject old digests.
Allow getting the size of specific digest.
Fix digest update function.
Calculate pkg digest in pkg_checksum.c
Add olddigest field.
Fix upgrade script for repos.
Special support for pkg 1.2 repos.
Improve debug message.
Do not crash on package without reponame.
Merge pull request #817 from vstakhov/pkg-checksum

Pkg checksums rework.

A quick summary of the digests changes:

- checksums now contain version and digests_suite id which includes hashing and encoding functions
- all checksums operations are now in `pkg_checksum.c`
- checksums type can now be found in repo `meta`
- if a checksum is in a wrong format, `pkg` tries to upgrade it
- a compatibility layer for pkg 1.2 repos has been added