Class: Google::Apis::SafebrowsingV4::RawHashes

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/safebrowsing_v4/classes.rb,
generated/google/apis/safebrowsing_v4/representations.rb,
generated/google/apis/safebrowsing_v4/representations.rb

Overview

The uncompressed threat entries in hash format of a particular prefix length. Hashes can be anywhere from 4 to 32 bytes in size. A large majority are 4 bytes, but some hashes are lengthened if they collide with the hash of a popular URL. Used for sending ThreatEntrySet to clients that do not support compression, or when sending non-4-byte hashes to clients that do support compression.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ RawHashes

Returns a new instance of RawHashes.



499
500
501
# File 'generated/google/apis/safebrowsing_v4/classes.rb', line 499

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#prefix_sizeFixnum

The number of bytes for each prefix encoded below. This field can be anywhere from 4 (shortest prefix) to 32 (full SHA256 hash). Corresponds to the JSON property prefixSize

Returns:

  • (Fixnum)


489
490
491
# File 'generated/google/apis/safebrowsing_v4/classes.rb', line 489

def prefix_size
  @prefix_size
end

#raw_hashesString

The hashes, in binary format, concatenated into one long string. Hashes are sorted in lexicographic order. For JSON API users, hashes are base64-encoded. Corresponds to the JSON property rawHashes NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)


497
498
499
# File 'generated/google/apis/safebrowsing_v4/classes.rb', line 497

def raw_hashes
  @raw_hashes
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



504
505
506
507
# File 'generated/google/apis/safebrowsing_v4/classes.rb', line 504

def update!(**args)
  @prefix_size = args[:prefix_size] if args.key?(:prefix_size)
  @raw_hashes = args[:raw_hashes] if args.key?(:raw_hashes)
end