summaryrefslogtreecommitdiff
path: root/host/lib21/include/host_misc21.h
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib21/include/host_misc21.h')
-rw-r--r--host/lib21/include/host_misc21.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/host/lib21/include/host_misc21.h b/host/lib21/include/host_misc21.h
new file mode 100644
index 00000000..795ebb23
--- /dev/null
+++ b/host/lib21/include/host_misc21.h
@@ -0,0 +1,26 @@
+/* Copyright 2015 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef VBOOT_REFERENCE_HOST_MISC2_H_
+#define VBOOT_REFERENCE_HOST_MISC2_H_
+
+#include <stdint.h>
+#include <stdio.h>
+
+#include "2id.h"
+
+/* Length of string representation, including trailing '\0' */
+#define VB2_ID_MIN_STRLEN (2 * VB2_ID_NUM_BYTES + 1)
+
+/**
+ * Convert hex string to struct vb2_id.
+ *
+ * @param str Example: "01ABef000042"
+ * @param id Destination for binary representation
+ * @return VB2_SUCCESS, or non-zero if error.
+ */
+vb2_error_t vb2_str_to_id(const char *str, struct vb2_id *id);
+
+#endif /* VBOOT_REFERENCE_HOST_MISC2_H_ */