{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-safe-browsing/json-schema/google-safe-browsing-google-security-safebrowsing-v5-hash-list-schema.json",
  "title": "GoogleSecuritySafebrowsingV5HashList",
  "description": "A list of hashes identified by its name.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-safe-browsing-safebrowsing-hash-list-api-openapi.yml#/components/schemas/GoogleSecuritySafebrowsingV5HashList",
  "properties": {
    "compressedRemovals": {
      "$ref": "#/$defs/GoogleSecuritySafebrowsingV5RiceDeltaEncoded32Bit",
      "description": "The Rice-delta encoded version of removal indices. Since each hash list definitely has less than 2^32 entries, the indices are treated as 32-bit integers and encoded."
    },
    "additionsThirtyTwoBytes": {
      "$ref": "#/$defs/GoogleSecuritySafebrowsingV5RiceDeltaEncoded256Bit",
      "description": "The 32-byte additions."
    },
    "name": {
      "type": "string",
      "description": "The name of the hash list. Note that the Global Cache is also just a hash list and can be referred to here."
    },
    "additionsSixteenBytes": {
      "$ref": "#/$defs/GoogleSecuritySafebrowsingV5RiceDeltaEncoded128Bit",
      "description": "The 16-byte additions."
    },
    "additionsEightBytes": {
      "$ref": "#/$defs/GoogleSecuritySafebrowsingV5RiceDeltaEncoded64Bit",
      "description": "The 8-byte additions."
    },
    "additionsFourBytes": {
      "$ref": "#/$defs/GoogleSecuritySafebrowsingV5RiceDeltaEncoded32Bit",
      "description": "The 4-byte additions."
    },
    "metadata": {
      "$ref": "#/$defs/GoogleSecuritySafebrowsingV5HashListMetadata",
      "description": "Metadata about the hash list. This is not populated by the `GetHashList` method, but this is populated by the `ListHashLists` method."
    },
    "partialUpdate": {
      "description": "When true, this is a partial diff containing additions and removals based on what the client already has. When false, this is the complete hash list. When false, the client MUST delete any locally stored version for this hash list. This means that either the version possessed by the client is seriously out-of-date or the client data is believed to be corrupt. The `compressed_removals` field will be empty. When true, the client MUST apply an incremental update by applying removals and then additions.",
      "type": "boolean"
    },
    "minimumWaitDuration": {
      "type": "string",
      "format": "google-duration",
      "description": "Clients should wait at least this long to get the hash list again. If omitted or zero, clients SHOULD fetch immediately because it indicates that the server has an additional update to be sent to the client, but could not due to the client-specified constraints."
    },
    "version": {
      "type": "string",
      "description": "The version of the hash list. The client MUST NOT manipulate those bytes.",
      "format": "byte"
    },
    "sha256Checksum": {
      "type": "string",
      "format": "byte",
      "description": "The sorted list of all hashes, hashed again with SHA256. This is the checksum for the sorted list of all hashes present in the database after applying the provided update. In the case that no updates were provided, the server will omit this field to indicate that the client should use the existing checksum."
    }
  },
  "type": "object",
  "$defs": {
    "GoogleSecuritySafebrowsingV5HashListMetadata": {
      "description": "Metadata about a particular hash list.",
      "type": "object",
      "properties": {
        "likelySafeTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "LIKELY_SAFE_TYPE_UNSPECIFIED",
              "GENERAL_BROWSING",
              "CSD",
              "DOWNLOAD"
            ]
          },
          "description": "Unordered list. If not empty, this specifies that the hash list represents a list of likely safe hashes, and this enumerates the ways they are considered likely safe. This field is mutually exclusive with the threat_types field."
        },
        "description": {
          "description": "A human-readable description about this list. Written in English.",
          "type": "string"
        },
        "hashLength": {
          "type": "string",
          "enum": [
            "HASH_LENGTH_UNSPECIFIED",
            "FOUR_BYTES",
            "EIGHT_BYTES",
            "SIXTEEN_BYTES",
            "THIRTY_TWO_BYTES"
          ],
          "description": "The supported hash length for this hash list. Each hash list will support exactly one length. If a different hash length is introduced for the same set of threat types or safe types, it will be introduced as a separate list with a distinct name and respective hash length set."
        },
        "threatTypes": {
          "description": "Unordered list. If not empty, this specifies that the hash list is a kind of threat list, and this enumerates the kind of threats associated with hashes or hash prefixes in this hash list. May be empty if the entry does not represent a threat, i.e. in the case that it represents a likely safe type.",
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "THREAT_TYPE_UNSPECIFIED",
              "MALWARE",
              "SOCIAL_ENGINEERING",
              "UNWANTED_SOFTWARE",
              "POTENTIALLY_HARMFUL_APPLICATION"
            ]
          }
        }
      }
    },
    "GoogleSecuritySafebrowsingV5RiceDeltaEncoded128Bit": {
      "properties": {
        "entriesCount": {
          "description": "The number of entries that are delta encoded in the encoded data. If only a single integer was encoded, this will be zero and the single value will be stored in `first_value`.",
          "format": "int32",
          "type": "integer"
        },
        "firstValueLo": {
          "format": "uint64",
          "type": "string",
          "description": "The lower 64 bits of the first entry in the encoded data (hashes). If the field is empty, the lower 64 bits are all zero."
        },
        "encodedData": {
          "description": "The encoded deltas that are encoded using the Golomb-Rice coder.",
          "type": "string",
          "format": "byte"
        },
        "firstValueHi": {
          "type": "string",
          "description": "The upper 64 bits of the first entry in the encoded data (hashes). If the field is empty, the upper 64 bits are all zero.",
          "format": "uint64"
        },
        "riceParameter": {
          "format": "int32",
          "type": "integer",
          "description": "The Golomb-Rice parameter. This parameter is guaranteed to be between 99 and 126, inclusive."
        }
      },
      "type": "object",
      "description": "Same as `RiceDeltaEncoded32Bit` except this encodes 128-bit numbers."
    },
    "GoogleSecuritySafebrowsingV5RiceDeltaEncoded256Bit": {
      "properties": {
        "firstValueFourthPart": {
          "format": "uint64",
          "type": "string",
          "description": "The last 64 bits of the first entry in the encoded data (hashes). If the field is empty, the last 64 bits are all zero."
        },
        "entriesCount": {
          "type": "integer",
          "description": "The number of entries that are delta encoded in the encoded data. If only a single integer was encoded, this will be zero and the single value will be stored in `first_value`.",
          "format": "int32"
        },
        "encodedData": {
          "format": "byte",
          "description": "The encoded deltas that are encoded using the Golomb-Rice coder.",
          "type": "string"
        },
        "riceParameter": {
          "format": "int32",
          "description": "The Golomb-Rice parameter. This parameter is guaranteed to be between 227 and 254, inclusive.",
          "type": "integer"
        },
        "firstValueSecondPart": {
          "type": "string",
          "format": "uint64",
          "description": "The 65 through 128th bits of the first entry in the encoded data (hashes). If the field is empty, the 65 through 128th bits are all zero."
        },
        "firstValueFirstPart": {
          "description": "The first 64 bits of the first entry in the encoded data (hashes). If the field is empty, the first 64 bits are all zero.",
          "type": "string",
          "format": "uint64"
        },
        "firstValueThirdPart": {
          "format": "uint64",
          "type": "string",
          "description": "The 129 through 192th bits of the first entry in the encoded data (hashes). If the field is empty, the 129 through 192th bits are all zero."
        }
      },
      "type": "object",
      "description": "Same as `RiceDeltaEncoded32Bit` except this encodes 256-bit numbers."
    },
    "GoogleSecuritySafebrowsingV5RiceDeltaEncoded32Bit": {
      "description": "The Rice-Golomb encoded data. Used for either hashes or removal indices. It is guaranteed that every hash or index here has the same length, and this length is exactly 32 bits. Generally speaking, if we sort all the entries lexicographically, we will find that the higher order bits tend not to change as frequently as lower order bits. This means that if we also take the adjacent difference between entries, the higher order bits have a high probability of being zero. This exploits this high probability of zero by essentially choosing a certain number of bits; all bits more significant than this are likely to be zero so we use unary encoding. See the `rice_parameter` field. Historical note: the Rice-delta encoding was first used in V4 of this API. In V5, two significant improvements were made: firstly, the Rice-delta encoding is now available with hash prefixes longer than 4 bytes; secondly, the encoded data are now treated as big-endian so as to avoid a costly sorting step.",
      "properties": {
        "encodedData": {
          "description": "The encoded deltas that are encoded using the Golomb-Rice coder.",
          "type": "string",
          "format": "byte"
        },
        "entriesCount": {
          "format": "int32",
          "description": "The number of entries that are delta encoded in the encoded data. If only a single integer was encoded, this will be zero and the single value will be stored in `first_value`.",
          "type": "integer"
        },
        "riceParameter": {
          "type": "integer",
          "description": "The Golomb-Rice parameter. This parameter is guaranteed to be between 3 and 30, inclusive.",
          "format": "int32"
        },
        "firstValue": {
          "description": "The first entry in the encoded data (hashes or indices), or, if only a single hash prefix or index was encoded, that entry's value. If the field is empty, the entry is zero.",
          "type": "integer",
          "format": "uint32"
        }
      },
      "type": "object"
    },
    "GoogleSecuritySafebrowsingV5RiceDeltaEncoded64Bit": {
      "properties": {
        "entriesCount": {
          "type": "integer",
          "format": "int32",
          "description": "The number of entries that are delta encoded in the encoded data. If only a single integer was encoded, this will be zero and the single value will be stored in `first_value`."
        },
        "riceParameter": {
          "format": "int32",
          "description": "The Golomb-Rice parameter. This parameter is guaranteed to be between 35 and 62, inclusive.",
          "type": "integer"
        },
        "firstValue": {
          "type": "string",
          "format": "uint64",
          "description": "The first entry in the encoded data (hashes), or, if only a single hash prefix was encoded, that entry's value. If the field is empty, the entry is zero."
        },
        "encodedData": {
          "description": "The encoded deltas that are encoded using the Golomb-Rice coder.",
          "type": "string",
          "format": "byte"
        }
      },
      "description": "Same as `RiceDeltaEncoded32Bit` except this encodes 64-bit numbers.",
      "type": "object"
    }
  }
}