absmartly-sdk 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a63e1c39032b6a7427c760d5b657d69bcee386e66f9bf4f809e1638d0224251
4
- data.tar.gz: e8e2acb8a335ce2705aa22e72d000cde80e9a089daa16a4f096ebb3a4bdee88a
3
+ metadata.gz: 88583d2ef2d2e30b6e3ae0cd792b6ba9878f77e11f6ac4b71f7cccb6af54e949
4
+ data.tar.gz: 1765353f85830fafc82d11419eb9c6e6570a27ad16f15a5f04c463fbf5775286
5
5
  SHA512:
6
- metadata.gz: 8d7876ef4191d0da54a36aabb7b1c0da583182316ba618bb13cd5674c75063aae212d25cfd35761c29966c8d58c91187466fbab04e50cdabd6f051d5443dba97
7
- data.tar.gz: 2fff9f84a10749f2bd9a65a505590e029364a21a20ea2622fd6a8de41c4b91cf11105b5a4aa5c42a163474ddbd7ea4d82aa768c6eeac39dbf73ffc23723293d6
6
+ metadata.gz: 4330e0c76860055b646b430a5ff598112e65bbcdbb661a2601f72346f95f16777aeb6782d6a1f9b493f9941a182c22f2ed22ee114f72b08b3dbaad03c50b7639
7
+ data.tar.gz: 61068750226957ca03280428846336a3166390181a08c138cc26a48d7967576bc2233542bd1797565473cde5ce0c23e4b0706a9b32465572025fc89043fff162
data/Gemfile CHANGED
@@ -6,7 +6,6 @@ source "https://rubygems.org"
6
6
  gemspec
7
7
 
8
8
  gem "rake", "~> 13.0"
9
- gem "arraybuffer"
10
9
  gem "murmurhash3"
11
10
  gem "faraday"
12
11
 
data/Gemfile.lock CHANGED
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- absmartly-sdk (1.1.0)
5
- arraybuffer (~> 0.0.6)
4
+ absmartly-sdk (1.1.1)
6
5
  faraday (~> 2.0)
7
6
  faraday-retry (~> 2.0)
8
7
  murmurhash3 (~> 0.1.7)
@@ -10,7 +9,6 @@ PATH
10
9
  GEM
11
10
  remote: https://rubygems.org/
12
11
  specs:
13
- arraybuffer (0.0.6)
14
12
  ast (2.4.2)
15
13
  byebug (11.1.3)
16
14
  diff-lcs (1.5.0)
@@ -33,7 +31,8 @@ GEM
33
31
  regexp_parser (2.5.0)
34
32
  reline (0.1.5)
35
33
  io-console (~> 0.5)
36
- rexml (3.2.5)
34
+ rexml (3.2.8)
35
+ strscan (>= 3.0.9)
37
36
  rspec (3.11.0)
38
37
  rspec-core (~> 3.11.0)
39
38
  rspec-expectations (~> 3.11.0)
@@ -61,6 +60,7 @@ GEM
61
60
  parser (>= 3.1.1.0)
62
61
  ruby-progressbar (1.11.0)
63
62
  ruby2_keywords (0.0.5)
63
+ strscan (3.1.0)
64
64
  unicode-display_width (2.2.0)
65
65
 
66
66
  PLATFORMS
@@ -69,7 +69,6 @@ PLATFORMS
69
69
 
70
70
  DEPENDENCIES
71
71
  absmartly-sdk!
72
- arraybuffer
73
72
  byebug
74
73
  faraday
75
74
  irb
data/absmartly.gemspec CHANGED
@@ -35,7 +35,6 @@ Gem::Specification.new do |spec|
35
35
  spec.add_dependency "faraday", "~> 2.0"
36
36
  spec.add_dependency "faraday-retry", "~> 2.0"
37
37
  spec.add_dependency "murmurhash3", "~> 0.1.7"
38
- spec.add_dependency "arraybuffer", "~> 0.0.6"
39
38
 
40
39
  # For more information and examples about making a new gem, check out our
41
40
  # guide at: https://bundler.io/guides/creating_gem.html
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "arraybuffer"
4
3
  require "murmurhash3"
5
4
 
6
5
  module Absmartly
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Absmartly
4
- VERSION = "1.1.0"
4
+ VERSION = "1.1.1"
5
5
  end
data/lib/absmartly.rb CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  require_relative "absmartly/version"
4
4
  require_relative "absmartly/variant_assigner"
5
- require_relative "absmartly/md5"
6
5
  require_relative "a_b_smartly"
7
6
  require_relative "a_b_smartly_config"
8
7
  require_relative "client"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: absmartly-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - absmartly
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-29 00:00:00.000000000 Z
11
+ date: 2024-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.1.7
55
- - !ruby/object:Gem::Dependency
56
- name: arraybuffer
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: 0.0.6
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: 0.0.6
69
55
  description: Absmartly gem
70
56
  email:
71
57
  - sdks@absmartly.com
@@ -89,7 +75,6 @@ files:
89
75
  - lib/a_b_smartly.rb
90
76
  - lib/a_b_smartly_config.rb
91
77
  - lib/absmartly.rb
92
- - lib/absmartly/md5.rb
93
78
  - lib/absmartly/variant_assigner.rb
94
79
  - lib/absmartly/version.rb
95
80
  - lib/audience_deserializer.rb
@@ -172,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
157
  - !ruby/object:Gem::Version
173
158
  version: '0'
174
159
  requirements: []
175
- rubygems_version: 3.4.10
160
+ rubygems_version: 3.5.11
176
161
  signing_key:
177
162
  specification_version: 4
178
163
  summary: Absmartly gem
data/lib/absmartly/md5.rb DELETED
@@ -1,178 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "arraybuffer"
4
-
5
- module Absmartly
6
- class Md5
7
- def self.cmn (q, a, b, x, s, t)
8
- a = a + q + (x >> 0) + t # TODO >>>
9
- ((a << s) | (a >> (32 - s))) + b # TODO >>>
10
- end
11
-
12
- def self.ff(a, b, c, d, x, s, t)
13
- cmn((b & c) | (~b & d), a, b, x, s, t)
14
- end
15
-
16
- def self.gg(a, b, c, d, x, s, t)
17
- cmn((b & d) | (c & ~d), a, b, x, s, t)
18
- end
19
-
20
- def self.hh(a, b, c, d, x, s, t)
21
- cmn(b ^ c ^ d, a, b, x, s, t)
22
- end
23
-
24
- def self.ii(a, b, c, d, x, s, t)
25
- cmn(c ^ (b | ~d), a, b, x, s, t)
26
- end
27
-
28
- def self.md5_cycle(x, k)
29
- a = x[0]
30
- b = x[1]
31
- c = x[2]
32
- d = x[3]
33
-
34
- a = ff(a, b, c, d, k[0], 7, -680876936)
35
- d = ff(d, a, b, c, k[1], 12, -389564586)
36
- c = ff(c, d, a, b, k[2], 17, 606105819)
37
- b = ff(b, c, d, a, k[3], 22, -1044525330)
38
- a = ff(a, b, c, d, k[4], 7, -176418897)
39
- d = ff(d, a, b, c, k[5], 12, 1200080426)
40
- c = ff(c, d, a, b, k[6], 17, -1473231341)
41
- b = ff(b, c, d, a, k[7], 22, -45705983)
42
- a = ff(a, b, c, d, k[8], 7, 1770035416)
43
- d = ff(d, a, b, c, k[9], 12, -1958414417)
44
- c = ff(c, d, a, b, k[10], 17, -42063)
45
- b = ff(b, c, d, a, k[11], 22, -1990404162)
46
- a = ff(a, b, c, d, k[12], 7, 1804603682)
47
- d = ff(d, a, b, c, k[13], 12, -40341101)
48
- c = ff(c, d, a, b, k[14], 17, -1502002290)
49
- b = ff(b, c, d, a, k[15], 22, 1236535329)
50
-
51
- a = gg(a, b, c, d, k[1], 5, -165796510)
52
- d = gg(d, a, b, c, k[6], 9, -1069501632)
53
- c = gg(c, d, a, b, k[11], 14, 643717713)
54
- b = gg(b, c, d, a, k[0], 20, -373897302)
55
- a = gg(a, b, c, d, k[5], 5, -701558691)
56
- d = gg(d, a, b, c, k[10], 9, 38016083)
57
- c = gg(c, d, a, b, k[15], 14, -660478335)
58
- b = gg(b, c, d, a, k[4], 20, -405537848)
59
- a = gg(a, b, c, d, k[9], 5, 568446438)
60
- d = gg(d, a, b, c, k[14], 9, -1019803690)
61
- c = gg(c, d, a, b, k[3], 14, -187363961)
62
- b = gg(b, c, d, a, k[8], 20, 1163531501)
63
- a = gg(a, b, c, d, k[13], 5, -1444681467)
64
- d = gg(d, a, b, c, k[2], 9, -51403784)
65
- c = gg(c, d, a, b, k[7], 14, 1735328473)
66
- b = gg(b, c, d, a, k[12], 20, -1926607734)
67
-
68
- a = hh(a, b, c, d, k[5], 4, -378558)
69
- d = hh(d, a, b, c, k[8], 11, -2022574463)
70
- c = hh(c, d, a, b, k[11], 16, 1839030562)
71
- b = hh(b, c, d, a, k[14], 23, -35309556)
72
- a = hh(a, b, c, d, k[1], 4, -1530992060)
73
- d = hh(d, a, b, c, k[4], 11, 1272893353)
74
- c = hh(c, d, a, b, k[7], 16, -155497632)
75
- b = hh(b, c, d, a, k[10], 23, -1094730640)
76
- a = hh(a, b, c, d, k[13], 4, 681279174)
77
- d = hh(d, a, b, c, k[0], 11, -358537222)
78
- c = hh(c, d, a, b, k[3], 16, -722521979)
79
- b = hh(b, c, d, a, k[6], 23, 76029189)
80
- a = hh(a, b, c, d, k[9], 4, -640364487)
81
- d = hh(d, a, b, c, k[12], 11, -421815835)
82
- c = hh(c, d, a, b, k[15], 16, 530742520)
83
- b = hh(b, c, d, a, k[2], 23, -995338651)
84
-
85
- a = ii(a, b, c, d, k[0], 6, -198630844)
86
- d = ii(d, a, b, c, k[7], 10, 1126891415)
87
- c = ii(c, d, a, b, k[14], 15, -1416354905)
88
- b = ii(b, c, d, a, k[5], 21, -57434055)
89
- a = ii(a, b, c, d, k[12], 6, 1700485571)
90
- d = ii(d, a, b, c, k[3], 10, -1894986606)
91
- c = ii(c, d, a, b, k[10], 15, -1051523)
92
- b = ii(b, c, d, a, k[1], 21, -2054922799)
93
- a = ii(a, b, c, d, k[8], 6, 1873313359)
94
- d = ii(d, a, b, c, k[15], 10, -30611744)
95
- c = ii(c, d, a, b, k[6], 15, -1560198380)
96
- b = ii(b, c, d, a, k[13], 21, 1309151649)
97
- a = ii(a, b, c, d, k[4], 6, -145523070)
98
- d = ii(d, a, b, c, k[11], 10, -1120210379)
99
- c = ii(c, d, a, b, k[2], 15, 718787259)
100
- b = ii(b, c, d, a, k[9], 21, -343485551)
101
-
102
- x[0] = (a + x[0]) >> 0 # TODO >>>
103
- x[1] = (b + x[1]) >> 0 # TODO >>>
104
- x[2] = (c + x[2]) >> 0 # TODO >>>
105
- x[3] = (d + x[3]) >> 0 # TODO >>>
106
- end
107
-
108
- def self.process(new_bytes_buffer)
109
- key = DataView.new new_bytes_buffer, 0, new_bytes_buffer.length
110
-
111
- l = new_bytes_buffer.length
112
- n = l & ~63
113
- i = 0
114
- block = ArrayBuffer.new(16)
115
- state = ArrayBuffer.new(4)
116
-
117
- [1732584193, -271733879, -1732584194, 271733878].each_with_index do |el, index|
118
- state[index] = el
119
- end
120
-
121
- (0...n).step(64).each do |val|
122
- (0...16).each do |w|
123
- block[w] = key.getU32(val + (w << 2))
124
- end
125
-
126
- md5_cycle(state, block)
127
-
128
- i += 64
129
- end
130
-
131
- w = 0
132
- m = l & ~3
133
-
134
- (i...m).step(4).each do |val|
135
- block[w] = key.getU32(val)
136
- w += 1
137
- end
138
-
139
- p = l & 3
140
-
141
- case p
142
- when 3
143
- block[w] = 0x80000000 | key.getU8(i) | (key.getU8(i + 1) << 8) | (key.getU8(i + 2) << 16)
144
- w += 1
145
- when 2
146
- block[w] = 0x800000 | key.getUint8(i) | (key.getUint8(i + 1) << 8)
147
- w += 1
148
-
149
- when 1
150
- block[w] = 0x8000 | key.getUint8(i)
151
- w += 1
152
-
153
- else
154
- block[w] = 0x80
155
- w += 1
156
-
157
- end
158
-
159
- if w > 14
160
- (w...16).each do |v|
161
- block[v] = 0
162
- end
163
-
164
- md5_cycle(state, block)
165
- w = 0
166
- end
167
-
168
- (w...16).each do |v|
169
- block[v] = 0
170
- end
171
-
172
- block[14] = l << 3
173
- md5_cycle(state, block)
174
-
175
- state
176
- end
177
- end
178
- end