Module: AnkiRecord::Helpers::ChecksumHelper

Included in:
Note
Defined in:
lib/anki_record/helpers/checksum_helper.rb

Overview

A module for the method that calculates the checksum value of notes.

This checksum may be used by Anki to detect duplicates.

Instance Method Summary collapse

Instance Method Details

#checksum(sfld) ⇒ Object

Returns the integer representation of the first 8 characters of the SHA-1 digest of the sfld argument



14
15
16
# File 'lib/anki_record/helpers/checksum_helper.rb', line 14

def checksum(sfld)
  Digest::SHA1.hexdigest(sfld)[0...8].to_i(16).to_s
end