basho/yokozuna — pull request #410 by coderoshi (2014-07-02 03:15:04+00:00)
Title: Ensure uniqueness of _yz_id

Fixes #406

Change separator to be an asterisk. Encode types/buckets/keys (TBKs) `*` (%1) and `%` (%2) chars. This will halt any chance of `*` overlapping ids, and also encoding `%` will deal with the case of someone having the literal string `%1` in an id (it would encode to `%21`). And since `*` and `%` are relatively less commonly used characters for TBKs, it will reduce the cases of encoding being occurring.

We also add a numeric prefix to track the given _yz_id version. We can use this to upgrade doc indexes in the future.

Type1 = `type*bucket`
Bucket1 = `yay`
Type2 = `type`
Bucket2 = `bucket*yay`
Key = `k`
Partition = `0`

ID1 = `1*type%2Abucket*yay*k*0`
ID2 = `1*type*bucket%2Ayay*k*0`