graphaware / neo4j-uuid

GraphAware Runtime Module that assigns a UUID to all nodes (and relationships) in the graph transparently
103 stars 22 forks source link

UUID format and examples in doc #19

Closed ADTC closed 8 years ago

ADTC commented 8 years ago

Can you include the format definition of the UUID, as well as some examples? Is it a random string of characters, or a simple increment counter (1, 2, 3...)?

Also, is the format controllable?

Joshfindit commented 8 years ago

Are you referring to:

ADTC commented 8 years ago

"The version that neo4j-uuid generates when generating the UUID" That

luanne commented 8 years ago

@ADTC the UUID plugin uses http://stephenc.github.io/eaio-uuid/ internally to generate String UUIDs. You should be able to control the format by implementing com.graphaware.common.uuid.UuidGenerator and providing that implementation to com.graphaware.module.uuid,UuidModule.

At the moment however, there is no configuration exposed to allow you to specify a custom UUID generator in the properties file.

ADTC commented 8 years ago

Okay, sure. But can I see some examples? Just generate a bunch (using the same logic in this plugin) and paste here :)

ikwattro commented 8 years ago
46b57cf0-20d9-11e6-ae13-6a138d208807
46bd1e10-20d9-11e6-ae13-6a138d208807
46bd4520-20d9-11e6-ae13-6a138d208807
46bd4521-20d9-11e6-ae13-6a138d208807
46bd6c30-20d9-11e6-ae13-6a138d208807
46bd6c31-20d9-11e6-ae13-6a138d208807
46bdba50-20d9-11e6-ae13-6a138d208807
46bdba51-20d9-11e6-ae13-6a138d208807
46bde160-20d9-11e6-ae13-6a138d208807
46bde161-20d9-11e6-ae13-6a138d208807
ADTC commented 8 years ago

Haha great thanks. I see that most parts remain constant. It's not fully randomized in the whole string?

ikwattro commented 8 years ago

No, version 1 uuids are not randomized it uses the datetime and mac address as variants. I think only version4 uuids are randomized.

Joshfindit commented 8 years ago

Based on the replies, the official answer seems to be that it's UUID v1:

As per https://github.com/stephenc/eaio-uuid/blob/master/src/main/java/com/eaio/uuid/UUIDGen.java (the plugin mentioned):

*  Starting with version 2, this implementation tries to obtain the MAC address
*  of the network card.

Note: MAC address is only used for v1 UUIDs