diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-09-02 23:39:01 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-09-02 23:39:01 +0100 |
| commit | 8259e2771f85c33c531a83fe1a78668f158208da (patch) | |
| tree | 5f1f83a1a269c7ef5a889ae5c2727d2360315896 /src/util.cc | |
| parent | f2f2a2afc393dcaee747b97173d71a622d05d910 (diff) | |
Hopefully-correct PKL and AssetMap when using Interop PNG subtitles.
Diffstat (limited to 'src/util.cc')
| -rw-r--r-- | src/util.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/util.cc b/src/util.cc index ac2246c3..3d90ccaa 100644 --- a/src/util.cc +++ b/src/util.cc @@ -88,6 +88,17 @@ dcp::make_uuid () return string (buffer); } +string +dcp::make_digest (Data data) +{ + SHA_CTX sha; + SHA1_Init (&sha); + SHA1_Update (&sha, data.data().get(), data.size()); + byte_t byte_buffer[SHA_DIGEST_LENGTH]; + SHA1_Final (byte_buffer, &sha); + char digest[64]; + return Kumu::base64encode (byte_buffer, SHA_DIGEST_LENGTH, digest, 64); +} /** Create a digest for a file. * @param filename File name. |
