Skip to content

Commit

Permalink
Cast floats for Strings indexes in connection.cr (thanks @Tails)
Browse files Browse the repository at this point in the history
  • Loading branch information
daliborfilus committed Dec 17, 2019
1 parent d332129 commit 616e96a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/nats/connection.cr
Expand Up @@ -16,6 +16,7 @@ require "socket"
require "uri"
require "json"
require "openssl"
require "big"

require "./nuid"
require "./msg"
Expand Down Expand Up @@ -249,7 +250,7 @@ module NATS
rn = @rand.rand(Int64::MAX)
String::Builder.build(TOKEN_LENGTH) do |io|
(0...TOKEN_LENGTH).each do
io << NUID::DIGITS[rn % NUID::BASE]
io << NUID::DIGITS[(rn % NUID::BASE).to_big_i]
rn /= NUID::BASE
end
end
Expand Down

0 comments on commit 616e96a

Please sign in to comment.