diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index 8e7d96c07..a5636b849 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -4,7 +4,7 @@ ### Features Added -- Added `Azure::Core::Uuid::AsArray()` and `Azure::Core::Uuid::FromArray()` to enable reading or writing from an existing UUID. +- Added `Azure::Core::Uuid::AsArray()` and `Azure::Core::Uuid::CreateFromArray()` to enable reading or writing from an existing UUID. This is useful when the UUID was generated outside the Azure SDK, or needs to be used from a component outside the Azure SDK. ### Breaking Changes diff --git a/sdk/core/azure-core/inc/azure/core/uuid.hpp b/sdk/core/azure-core/inc/azure/core/uuid.hpp index aca80c3d8..7dacecb1d 100644 --- a/sdk/core/azure-core/inc/azure/core/uuid.hpp +++ b/sdk/core/azure-core/inc/azure/core/uuid.hpp @@ -42,7 +42,7 @@ namespace Azure { namespace Core { /** * @brief Returns the binary value of the Uuid for consumption by clients who need non-string - * representation of the Uuid + * representation of the Uuid. * @returns An array with the binary representation of the Uuid. */ std::array const& AsArray() const { return m_uuid; } @@ -57,6 +57,6 @@ namespace Azure { namespace Core { * @brief Construct a Uuid from an existing UUID represented as an array of bytes. * @details Creates a Uuid from a UUID created in an external scope. */ - static Uuid FromArray(std::array const& uuid); + static Uuid CreateFromArray(std::array const& uuid); }; }} // namespace Azure::Core diff --git a/sdk/core/azure-core/src/uuid.cpp b/sdk/core/azure-core/src/uuid.cpp index f474f24a5..9eb36b3d0 100644 --- a/sdk/core/azure-core/src/uuid.cpp +++ b/sdk/core/azure-core/src/uuid.cpp @@ -77,7 +77,7 @@ namespace Azure { namespace Core { return Uuid(uuid); } - Uuid Uuid::FromArray(std::array const& uuid) + Uuid Uuid::CreateFromArray(std::array const& uuid) { Uuid rv{uuid.data()}; return rv; diff --git a/sdk/core/azure-core/test/ut/uuid_test.cpp b/sdk/core/azure-core/test/ut/uuid_test.cpp index ab89466a5..157b4b453 100644 --- a/sdk/core/azure-core/test/ut/uuid_test.cpp +++ b/sdk/core/azure-core/test/ut/uuid_test.cpp @@ -18,7 +18,7 @@ TEST(Uuid, Transparent) { auto uuid1 = Uuid::CreateUuid(); auto arrayUuid1(uuid1.AsArray()); - auto uuid2 = Azure::Core::Uuid::FromArray(arrayUuid1); + auto uuid2 = Azure::Core::Uuid::CreateFromArray(arrayUuid1); EXPECT_EQ(uuid1.ToString(), uuid2.ToString()); }