couchbase-id 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/couchbase-id/generator.rb +3 -3
- data/lib/couchbase-id/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c88422fe5d43de7b3121f7cf28bac0a8f25d7816
|
4
|
+
data.tar.gz: 47761ffa379baca44361463c3bfdef8f28a88122
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ac1ac8b518a0bb7201cd4fae6ce26af8539ce4ef6dad318bd18cb95cf3ea3048fbd96a7c57d726f3e4971970b473a825e94c2862ee71d22beaeaf5bdf665668
|
7
|
+
data.tar.gz: c2981574f72617ed488a5eca2ec8a568a3a4a7280464984ec122c9fafe1805dc5ed201bd8205d7ab92399037067ceb6f06dfe1533f63e12640ba552b57ac2260
|
@@ -26,11 +26,11 @@ module CouchbaseId
|
|
26
26
|
|
27
27
|
|
28
28
|
# Basic compression using UTF (more efficient for ID's stored as strings)
|
29
|
-
|
29
|
+
B64 ||= Radix::Base.new(Radix::BASE::B62 + ['_', '~'])
|
30
30
|
B10 ||= Radix::Base.new(10)
|
31
31
|
|
32
32
|
# The cluster id this node belongs to (avoids XDCR clashes)
|
33
|
-
CLUSTER_ID ||= Radix.convert((ENV['COUCHBASE_CLUSTER'] || 1), B10,
|
33
|
+
CLUSTER_ID ||= Radix.convert((ENV['COUCHBASE_CLUSTER'] || 1), B10, B64) # Cluster ID number
|
34
34
|
|
35
35
|
# instance method
|
36
36
|
def generate_id
|
@@ -94,7 +94,7 @@ module CouchbaseId
|
|
94
94
|
before_create :generate_id
|
95
95
|
|
96
96
|
def self.default_class_id_generator(overflow, count)
|
97
|
-
id = Radix.convert(overflow, B10,
|
97
|
+
id = Radix.convert(overflow, B10, B64) + Radix.convert(count, B10, B64)
|
98
98
|
"#{self.design_document}_#{CLUSTER_ID}-#{id}"
|
99
99
|
end
|
100
100
|
|
data/lib/couchbase-id/version.rb
CHANGED