• brian m. carlson's avatar
    hex: introduce functions to print arbitrary hashes · 47edb649
    brian m. carlson authored
    Currently, we have functions that turn an arbitrary SHA-1 value or an
    object ID into hex format, either using a static buffer or with a
    user-provided buffer.  Add variants of these functions that can handle
    an arbitrary hash algorithm, specified by constant.  Update the
    documentation as well.
    While we're at it, remove the "extern" declaration from this family of
    functions, since it's not needed and our style now recommends against
    We use the variant taking the algorithm structure pointer as the
    internal variant, since taking an algorithm pointer is the easiest way
    to handle all of the variants in use.
    Note that we maintain these functions because there are hashes which
    must change based on the hash algorithm in use but are not object IDs
    (such as pack checksums).
    Signed-off-by: brian m. carlson's avatarbrian m. carlson <sandals@crustytoothpaste.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
hex.c 3.39 KB