<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/webrisk/v1/webrisk.proto

namespace Google\Cloud\WebRisk\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * The uncompressed threat entries in hash format.
 * 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 URI.
 * Used for sending ThreatEntryAdditons to clients that do not support
 * compression, or when sending non-4-byte hashes to clients that do support
 * compression.
 *
 * Generated from protobuf message <code>google.cloud.webrisk.v1.RawHashes</code>
 */
class RawHashes extends \Google\Protobuf\Internal\Message
{
    /**
     * The number of bytes for each prefix encoded below.  This field can be
     * anywhere from 4 (shortest prefix) to 32 (full SHA256 hash).
     * In practice this is almost always 4, except in exceptional circumstances.
     *
     * Generated from protobuf field <code>int32 prefix_size = 1;</code>
     */
    private $prefix_size = 0;
    /**
     * The hashes, in binary format, concatenated into one long string. Hashes are
     * sorted in lexicographic order. For JSON API users, hashes are
     * base64-encoded.
     *
     * Generated from protobuf field <code>bytes raw_hashes = 2;</code>
     */
    private $raw_hashes = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $prefix_size
     *           The number of bytes for each prefix encoded below.  This field can be
     *           anywhere from 4 (shortest prefix) to 32 (full SHA256 hash).
     *           In practice this is almost always 4, except in exceptional circumstances.
     *     @type string $raw_hashes
     *           The hashes, in binary format, concatenated into one long string. Hashes are
     *           sorted in lexicographic order. For JSON API users, hashes are
     *           base64-encoded.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Webrisk\V1\Webrisk::initOnce();
        parent::__construct($data);
    }

    /**
     * The number of bytes for each prefix encoded below.  This field can be
     * anywhere from 4 (shortest prefix) to 32 (full SHA256 hash).
     * In practice this is almost always 4, except in exceptional circumstances.
     *
     * Generated from protobuf field <code>int32 prefix_size = 1;</code>
     * @return int
     */
    public function getPrefixSize()
    {
        return $this->prefix_size;
    }

    /**
     * The number of bytes for each prefix encoded below.  This field can be
     * anywhere from 4 (shortest prefix) to 32 (full SHA256 hash).
     * In practice this is almost always 4, except in exceptional circumstances.
     *
     * Generated from protobuf field <code>int32 prefix_size = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setPrefixSize($var)
    {
        GPBUtil::checkInt32($var);
        $this->prefix_size = $var;

        return $this;
    }

    /**
     * The hashes, in binary format, concatenated into one long string. Hashes are
     * sorted in lexicographic order. For JSON API users, hashes are
     * base64-encoded.
     *
     * Generated from protobuf field <code>bytes raw_hashes = 2;</code>
     * @return string
     */
    public function getRawHashes()
    {
        return $this->raw_hashes;
    }

    /**
     * The hashes, in binary format, concatenated into one long string. Hashes are
     * sorted in lexicographic order. For JSON API users, hashes are
     * base64-encoded.
     *
     * Generated from protobuf field <code>bytes raw_hashes = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setRawHashes($var)
    {
        GPBUtil::checkString($var, False);
        $this->raw_hashes = $var;

        return $this;
    }

}

