class Hashtastic::ListHasher

Public Class Methods

call(values, &block) click to toggle source
# File lib/hashtastic/list_hasher.rb, line 5
def self.call(values, &block)
  hasher = Digest::SHA3.new(256)

  values.each do |value|
    value = block.call(value) if block

    hasher.update(value.to_s)
  end

  "0x#{hasher.hexdigest}"
end