summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-11-08 20:06:08 +0100
committerMarc-André Lureau <marcandre.lureau@gmail.com>2013-11-08 20:06:08 +0100
commitbb70598493e6354fcef0abceb4317062dd8fbe18 (patch)
tree3af68263652beca1397055c1926d87315d3aca66 /tools
parent963499511cf0997a6c1adf7e758efbe8d72940d4 (diff)
downloadmsitools-bb70598493e6354fcef0abceb4317062dd8fbe18.zip
msitools-bb70598493e6354fcef0abceb4317062dd8fbe18.tar.gz
msitools-bb70598493e6354fcef0abceb4317062dd8fbe18.tar.xz
wixl: move uuid_from_name in util
Diffstat (limited to 'tools')
-rw-r--r--tools/wixl/builder.vala20
-rw-r--r--tools/wixl/util.vala20
2 files changed, 20 insertions, 20 deletions
diff --git a/tools/wixl/builder.vala b/tools/wixl/builder.vala
index 4de679a..fbb3293 100644
--- a/tools/wixl/builder.vala
+++ b/tools/wixl/builder.vala
@@ -381,26 +381,6 @@ namespace Wixl {
SHARED,
}
- /* Namespace UUID: {de73ba5a-ed96-4a66-ba1b-fbb44e659ad7} */
- private static string uuid_namespace =
- "\xde\x73\xba\x5a\xed\x96\x4a\x66\xba\x1b\xfb\xb4\x4e\x65\x9a\xd7";
-
- private static string uuid_from_name(string s) {
- var cs = new Checksum (ChecksumType.SHA1);
- uint8 buffer[20];
- size_t buflen = buffer.length;
-
- cs.update (uuid_namespace.data, 16);
- cs.update (s.data, s.length);
- cs.get_digest (buffer, ref buflen);
-
- return "{%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X}".
- printf(buffer[0], buffer[1], buffer[2], buffer[3],
- buffer[4], buffer[5], (buffer[6] & 15) | 0x50, buffer[7],
- (buffer[8] & 0x3F) | 0x80, buffer[9], buffer[10], buffer[11],
- buffer[12], buffer[13], buffer[14], buffer[15]);
- }
-
WixKeyElement? component_default_key = null;
int component_children_count;
diff --git a/tools/wixl/util.vala b/tools/wixl/util.vala
index f8dd0da..d91baca 100644
--- a/tools/wixl/util.vala
+++ b/tools/wixl/util.vala
@@ -76,6 +76,26 @@ namespace Wixl {
return indented;
}
+ /* Namespace UUID: {de73ba5a-ed96-4a66-ba1b-fbb44e659ad7} */
+ static const string uuid_namespace =
+ "\xde\x73\xba\x5a\xed\x96\x4a\x66\xba\x1b\xfb\xb4\x4e\x65\x9a\xd7";
+
+ public static string uuid_from_name(string s) {
+ var cs = new Checksum (ChecksumType.SHA1);
+ uint8 buffer[20];
+ size_t buflen = buffer.length;
+
+ cs.update (uuid_namespace.data, 16);
+ cs.update (s.data, s.length);
+ cs.get_digest (buffer, ref buflen);
+
+ return "{%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X}".
+ printf(buffer[0], buffer[1], buffer[2], buffer[3],
+ buffer[4], buffer[5], (buffer[6] & 15) | 0x50, buffer[7],
+ (buffer[8] & 0x3F) | 0x80, buffer[9], buffer[10], buffer[11],
+ buffer[12], buffer[13], buffer[14], buffer[15]);
+ }
+
public string generate_id (string prefix, uint n, ...) {
var l = va_list ();
var args = new string[n];