This util function uses the generic libavutil hash API to hash any data with the specified algorithm to a bstr. It deduplicates multiple hash routines used in mpv.