Sha256: 034ed870349913439a3ce57497c1dad465ab38963e59c821b1281b0ac7f83266

Contents?: true

Size: 252 Bytes

Versions: 2

Compression:

Stored size: 252 Bytes

Contents

require 'digest/stringbuffer'

class Test < Digest::StringBuffer
  def initialize
    @prime = 31
  end

  def finish
    result = 0
    buffer.unpack("C*").each do |c|
      result += (c * @prime)
    end
    [result & 0xffffffff].pack("N")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
digest-stringbuffer-0.0.2 spec/spec_helper.rb
digest-stringbuffer-0.0.1 spec/spec_helper.rb