Module: Ace::PromptPrep::Atoms::ContentHasher
- Defined in:
- lib/ace/prompt_prep/atoms/content_hasher.rb
Overview
Generates SHA256 hash for content
Class Method Summary collapse
-
.call(content:) ⇒ Hash
Generate hash for content.
Class Method Details
.call(content:) ⇒ Hash
Generate hash for content
14 15 16 17 18 19 20 |
# File 'lib/ace/prompt_prep/atoms/content_hasher.rb', line 14 def self.call(content:) if content.nil? || content.empty? {hash: ""} else {hash: Digest::SHA256.hexdigest(content)} end end |