EcoreUtil.generateUUID() [message #1697121] |
Mon, 01 June 2015 17:51 |
Al B Messages: 130 Registered: July 2009 |
Senior Member |
|
|
Can someone remind me why the EcoreUtil.generateUUID() doesn't generate UUIDs in five group numbers separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (32 alphanumeric characters and four hyphens). For example:
123e4567-e89b-12d3-a456-426655440000
Instead generates this:
_PNnQffT1EeSYNfDWIQWDJg
[Updated on: Mon, 01 June 2015 17:52] Report message to a moderator
|
|
|
|
Re: EcoreUtil.generateUUID() [message #1697160 is a reply to message #1697156] |
Tue, 02 June 2015 06:17 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
Hi,
I always thought this is because an ID in the XML world is not supposed
to start with a number?
Tom
On 02.06.15 06:54, Ed Merks wrote:
> Al,
>
> Because it was always that way. :-P
>
> It's hard to believe EMF is 15 years old and existed as a MOF
> implementation at IBM even before that. I don't recall exactly why we
> took this form, but two considerations are clear:
>
> One uses 36 characters the other 23, so so the choice made takes 2/3
> as much memory to represent. It's still sad that 8 bytes of information
> takes uses almost 90 bytes to represent, but XMI allows arbitrary IDs...
> One is not an xmi:ID and the other is. It seems good that an ID be an
> xsd:ID.
>
> In any case, the irony of a universally unique identifier is that to the
> human eye, they're no better than a blurry eye chart.
>
>
> On 01/06/2015 7:51 PM, Al B wrote:
>> Can someone remind me why the EcoreUtil.generateUUID() doesn't
>> generate UUIDs in five group numbers separated by hyphens, in the form
>> 8-4-4-4-12 for a total of 36 characters (32 alphanumeric characters
>> and four hyphens). For example:
>>
>> 123e4567-e89b-12d3-a456-426655440000
>>
>> Instead generates this:
>>
>> _PNnQffT1EeSYNfDWIQWDJg
>>
>>
>>
>>
>
|
|
|
Re: EcoreUtil.generateUUID() [message #1697185 is a reply to message #1697160] |
Tue, 02 June 2015 08:32 |
Ed Merks Messages: 33139 Registered: July 2009 |
Senior Member |
|
|
Tom,
Yes ID must be an NCName and that can't start with a number. That's
what I mean by "One is not an ID"...
On 02/06/2015 8:17 AM, Tom Schindl wrote:
> Hi,
>
> I always thought this is because an ID in the XML world is not supposed
> to start with a number?
>
> Tom
>
> On 02.06.15 06:54, Ed Merks wrote:
>> Al,
>>
>> Because it was always that way. :-P
>>
>> It's hard to believe EMF is 15 years old and existed as a MOF
>> implementation at IBM even before that. I don't recall exactly why we
>> took this form, but two considerations are clear:
>>
>> One uses 36 characters the other 23, so so the choice made takes 2/3
>> as much memory to represent. It's still sad that 8 bytes of information
>> takes uses almost 90 bytes to represent, but XMI allows arbitrary IDs...
>> One is not an xmi:ID and the other is. It seems good that an ID be an
>> xsd:ID.
>>
>> In any case, the irony of a universally unique identifier is that to the
>> human eye, they're no better than a blurry eye chart.
>>
>>
>> On 01/06/2015 7:51 PM, Al B wrote:
>>> Can someone remind me why the EcoreUtil.generateUUID() doesn't
>>> generate UUIDs in five group numbers separated by hyphens, in the form
>>> 8-4-4-4-12 for a total of 36 characters (32 alphanumeric characters
>>> and four hyphens). For example:
>>>
>>> 123e4567-e89b-12d3-a456-426655440000
>>>
>>> Instead generates this:
>>>
>>> _PNnQffT1EeSYNfDWIQWDJg
>>>
>>>
>>>
>>>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03509 seconds