Class: Nanoc::Int::Checksummer Private

Inherits:
Object
  • Object
show all
Defined in:
lib/nanoc/base/checksummer.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Creates checksums for given objects.

A checksum is a string, such as “mL+TaqNsEeiPkWloPgCtAofT1yg=”, that is used to determine whether a piece of data has changed.

Defined Under Namespace

Classes: ArrayUpdateBehavior, BinaryContentUpdateBehavior, CompactDigest, DataUpdateBehavior, DocumentUpdateBehavior, HashUpdateBehavior, NoUpdateBehavior, PathnameUpdateBehavior, RawUpdateBehavior, RescueUpdateBehavior, StringUpdateBehavior, ToIToSUpdateBehavior, ToSUpdateBehavior, UnwrapUpdateBehavior, UpdateBehavior, VerboseDigest

Class Method Summary collapse

Class Method Details

.calc(obj, digest_class = CompactDigest) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns The digest.

Parameters:

  • obj

    The object to create a checksum for

Returns:



41
42
43
44
45
# File 'lib/nanoc/base/checksummer.rb', line 41

def calc(obj, digest_class = CompactDigest)
  digest = digest_class.new
  update(obj, digest)
  digest.to_s
end