Sha256: 68f38c6ea2fe31fee206df89bc8a390894b36237f149185c2319d9fefd5b8ef9

Contents?: true

Size: 385 Bytes

Versions: 1

Compression:

Stored size: 385 Bytes

Contents

require 'digest'

module Digest
  class Simple < Class
    def initialize
      @buffer = ""
    end

    def reset
      @buffer.clear
      self
    end

    def update(str)
      @buffer += str
      self
    end
    alias << update

    def block_length
      0
    end

    private

    def finish
      fail NotImplementedError, "must be defined finish method"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
digest-simple-1.1.0 lib/digest/simple.rb