all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob b8fcb536ddcbff1a37e3bca72b9cc18c7dd8abc0 714 bytes (raw)
name: gnu/packages/aux-files/jsonnet-md5/md5.cpp 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
#include "md5.h"
#include <nettle/md5.h>
#include <nettle/base16.h>
#include <string>
#include <vector>

std::string
md5 (const std::string str)
{
  // Convert str to a byte array
  std::vector<uint8_t> input (str.begin (), str.end ());

  // Compute the digest
  struct md5_ctx nettle_ctx;
  md5_init (&nettle_ctx);
  md5_update (&nettle_ctx, input.size (), input.data ());
  uint8_t digest[MD5_DIGEST_SIZE];
  md5_digest (&nettle_ctx, MD5_DIGEST_SIZE, digest);

  // Encode it to base16
  std::vector<char> encoded (BASE16_ENCODE_LENGTH (MD5_DIGEST_SIZE));
  base16_encode_update (encoded.data (), MD5_DIGEST_SIZE, digest);
  std::string final_digest (encoded.begin (), encoded.end ());
  return final_digest;
}

debug log:

solving b8fcb536dd ...
found b8fcb536dd in https://yhetil.org/guix/a6b05ab7a106bdaa7677edfcadda4a101fb9d850.camel@planete-kraus.eu/ ||
	https://yhetil.org/guix/b8c23b18b9b032bce8bafb66c5dd8dd260e00015.camel@planete-kraus.eu/

applying [1/1] https://yhetil.org/guix/a6b05ab7a106bdaa7677edfcadda4a101fb9d850.camel@planete-kraus.eu/
diff --git a/gnu/packages/aux-files/jsonnet-md5/md5.cpp b/gnu/packages/aux-files/jsonnet-md5/md5.cpp
new file mode 100644
index 0000000000..b8fcb536dd

Checking patch gnu/packages/aux-files/jsonnet-md5/md5.cpp...
Applied patch gnu/packages/aux-files/jsonnet-md5/md5.cpp cleanly.

skipping https://yhetil.org/guix/b8c23b18b9b032bce8bafb66c5dd8dd260e00015.camel@planete-kraus.eu/ for b8fcb536dd
index at:
100644 b8fcb536ddcbff1a37e3bca72b9cc18c7dd8abc0	gnu/packages/aux-files/jsonnet-md5/md5.cpp

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.