Class: IABConsentString::Consent::VendorConsentEncoder

Inherits:
Object
  • Object
show all
Defined in:
lib/iab_consent_string/consent/vendor_consent_encoder.rb

Class Method Summary collapse

Class Method Details

.toBase64String(vendorConsent) ⇒ String

Encode vendor consent to Base64 string

Parameters:

Returns:

  • (String)

    Base64 encoded string



9
10
11
12
# File 'lib/iab_consent_string/consent/vendor_consent_encoder.rb', line 9

def self.toBase64String(vendorConsent)
  # Encode Without Padding to respect IAB Consent String Spec
  Base64.urlsafe_encode64(vendorConsent.toByteArray().pack("C*") , padding: false)
end