From 380ec5338597b61beb0b4f259d0eb5193154e10a Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Thu, 10 Aug 2017 15:43:34 +0200 Subject: [PATCH] use Uuid::getHex to retrieve hexa notation --- src/Rxnet/EventStore/NewEvent/JsonEvent.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Rxnet/EventStore/NewEvent/JsonEvent.php b/src/Rxnet/EventStore/NewEvent/JsonEvent.php index 0815b8e..7fdbe2e 100644 --- a/src/Rxnet/EventStore/NewEvent/JsonEvent.php +++ b/src/Rxnet/EventStore/NewEvent/JsonEvent.php @@ -37,12 +37,12 @@ public function setMetaData($meta) public function setId($id) { if(!$id) { - $id = Uuid::uuid4()->toString(); + $id = Uuid::uuid4()->getHex(); } elseif (!Uuid::isValid($id)) { - $id = Uuid::uuid3(Uuid::NAMESPACE_OID, $id)->toString(); + $id = Uuid::uuid3(Uuid::NAMESPACE_OID, $id)->getHex(); } - $id = hex2bin(str_replace('-', '', $id)); + $id = hex2bin($id); $this->message->setEventId($id); }