Commit de0be065 authored by Cypres TAC's avatar Cypres TAC
Browse files

Merge branch 'fix-uuid' into 'master'

Fix locationTemporaryPublicId computation

See merge request !38
parents b934a599 b10a8735
Pipeline #242004 passed with stages
in 8 minutes and 51 seconds
......@@ -299,7 +299,10 @@ public class CleaEciesEncoder {
byte[] tlidB = hmacSha256.doFinal(message.getBytes("UTF-8"));
/* Convert in UUID format */
byte[] tlidBTrunc = Arrays.copyOfRange(tlidB, 0, 16);
locationTemporaryPublicID = UUID.nameUUIDFromBytes(tlidBTrunc);
ByteBuffer bb = ByteBuffer.wrap(tlidBTrunc);
long high = bb.getLong();
long low = bb.getLong();
locationTemporaryPublicID = new UUID(high, low);
return locationTemporaryPublicID;
} catch (InvalidKeyException | NoSuchAlgorithmException | IllegalStateException | UnsupportedEncodingException e) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment