Class: Sekret::Checksum

Inherits:
Object
  • Object
show all
Defined in:
lib/sekret/checksum.rb

Overview

Checksum raw data

Author:

  • Maddie Schipper

Since:

  • 1.0.0

Class Method Summary collapse

Class Method Details

.hmac_sha256(key, payload) ⇒ String

Create a HMAC-SHA256 of a playload

Parameters:

  • key (String)

    The key for the hash

  • payload (String)

    The payload to hash

Returns:

  • (String)

    The HMAC-SHA256

Since:

  • 1.0.0



20
21
22
# File 'lib/sekret/checksum.rb', line 20

def hmac_sha256(key, payload)
  OpenSSL::HMAC.hexdigest('SHA256', key, payload)
end