Inexpensive generation of hierarchical unique IDs
- by romaninsh
My application is building a hierarchical structure like this:
root = {
'id': 'root',
'children': [ {
'name': 'root_foo',
'children': []
}, {
'id': 'root_foo2',
'children': [ {
'id': 'root_foo2_bar',
'children': []
} ]
} ]
}
in other words, it's a tree of nodes, where each node might have child elements…