Top Level Namespace

Defined Under Namespace

Modules: Stellate

Instance Method Summary collapse

Instance Method Details

#create_blake3_hash(str) ⇒ Object



177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/stellate.rb', line 177

def create_blake3_hash(str)
  val = 0

  return val if str.empty?

  str.each_byte do |code|
    val = (val << 5) - val + code
    val &= 0xffffffff # Int32
  end

  val >> 0 # uInt32
end