I think the format should be changed. Right now it just puts all the keys end to end, so if you have 2 different rings with the same keys like {{A, B}, {C}} and {{A}, {B, C}} it creates the same hash. They should be different. There should be some marker to separate subsets for each ring.