libchromeos: Functions to convert between strings and byte arrays

Added two utility functions GetBytesAsString() and GetStringAsBytes()
to convert data between std::string and std::vector<uint8_t> which
happens frequently when working with binary blobs that contain
string data.

BUG=brillo:10
TEST=FEATURES=test emerge-link libchromeos

Change-Id: Idb991568f22ee0eeb40bf081c240809d6fa4342a
Reviewed-on: https://chromium-review.googlesource.com/245735
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
3 files changed