lib/active_uxid/ulid.rb in active_uxid-1.0.3 vs lib/active_uxid/ulid.rb in active_uxid-1.0.4
- old
+ new
@@ -11,10 +11,10 @@
end
def uxid_encode
(1..ENCODING_LENGTH).reduce('') do |str, num|
shift = 128 - 5 * num
- str + ENCODING_CHARS[(uxid_octect >> shift) & 0x1f]
+ "#{str}#{ENCODING_CHARS[(uxid_octect >> shift) & 0x1f]}"
end
end
def uxid_bytes
"#{uxid_unixtime_48bit}#{SecureRandom.random_bytes(10)}"