ruby_xid 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ruby_xid.rb +1 -2
  3. data/lib/xid/base32.rb +1 -2
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc05ca0b9b3c67ac29d68ea4b957b089ee503a2090b95747cfe9514c101940ed
4
- data.tar.gz: 53518ae32bc8ecffe4e0f32b6d02284f447df4905d4cce72d84375a601a4950b
3
+ metadata.gz: 2a7334953c44afa55db41bc336ffcdafa4c975c145d140e51e7250ff45913b8d
4
+ data.tar.gz: d5f23db03539479e6f9a042a5f675027d8a6d834cf3eb0e4d20cd6b95c046d8b
5
5
  SHA512:
6
- metadata.gz: 24fb58cbe29a05bb81fdfb8db83a61d5c90dde101aa11a6e357331e9b23135201128b27a7fd2849760d71d00dca99d67002988788299633dae3ec696513e725a
7
- data.tar.gz: 691f01a19ad332bf78a64a384be0a583e729a0bc058caefa5deffc599f6f8f6b1c4439cfe526cd026a6738ee3cd01e3efd7dacd2883cf62194e3fa2bdf5c3c84
6
+ metadata.gz: 93c57a517ae13022868f6031d35b105bbebd1524953f3024c31e2c909fce816960a6f110b936399e1d02c1e67d037b60b739a2e5950db8094672feccbcbb9b1e
7
+ data.tar.gz: 016c493065f0db6b4dde30ab330ec8eb4a963bfe0db75682d2e2774f083bce5c0e22b170ce72611e9ce3b2c53b642df1839ca39103141a85fd330f1774a6d6ec
data/lib/ruby_xid.rb CHANGED
@@ -54,8 +54,7 @@ class Xid
54
54
 
55
55
  def string
56
56
  # type: () -> str
57
- byte_value = bytes
58
- Base32.b32encode(byte_value)[0..TRIM_LEN - 1]
57
+ Base32.b32encode(value)[0..TRIM_LEN - 1]
59
58
  end
60
59
 
61
60
  def bytes
data/lib/xid/base32.rb CHANGED
@@ -12,7 +12,6 @@ class Xid::Base32
12
12
  end
13
13
 
14
14
  def b32encode(src)
15
- src = src.chars.map(&:ord)
16
15
  encode(src, ENCODE_HEX)
17
16
  end
18
17
 
@@ -26,7 +25,7 @@ class Xid::Base32
26
25
  dst = []
27
26
  while src_str && !src_str.empty?
28
27
  src_len = src_str.length
29
- next_byte = [0] * 8
28
+ next_byte = Array.new(8, 0)
30
29
 
31
30
  if src_len > 4
32
31
  next_byte[7] = src_str[4] & 0x1f
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_xid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valarpiraichandran
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-09 00:00:00.000000000 Z
11
+ date: 2019-12-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: a.valarpirai@gmail.com