gcloud alpha storage hash

NAME
gcloud alpha storage hash - calculates hashes on local or cloud files
SYNOPSIS
gcloud alpha storage hash URLS [URLS …] [--additional-headers=HEADER=VALUE] [--hex] [--skip-crc32c     | --skip-md5] [--decryption-keys=[DECRYPTION_KEY,…]] [GCLOUD_WIDE_FLAG]
DESCRIPTION
(ALPHA) Calculates hashes on local or cloud files that can be used to compare with "gcloud storage ls -L" output. If a specific hash option is not provided, this command calculates all gcloud storage-supported hashes for the file.

Note that gcloud storage automatically performs hash validation when uploading or downloading files, so this command is only needed if you want to write a script that separately checks the hash for some reason.

If you calculate a CRC32C hash for the file without a precompiled google-crc32c installation, hashing will be very slow.

EXAMPLES
To get the MD5 and CRC32C hash digest of a cloud object in Base64 format:
gcloud alpha storage hash gs://bucket/object

To get just the MD5 hash digest of a local object in hex format:

gcloud alpha storage hash /dir/object.txt --skip-crc32c --hex
POSITIONAL ARGUMENTS
URLS [URLS …]
Local or cloud URLs of objects to hash.
FLAGS
--additional-headers=HEADER=VALUE
Includes arbitrary headers in storage API calls. Accepts a comma separated list of key=value pairs, e.g. header1=value1,header2=value2. Overrides the default storage/additional_headers property value for this command invocation.
--hex
Output hash digests in hex format. By default, digests are displayed in base64.
At most one of these can be specified:
--skip-crc32c
Skip CRC32C hash calculation. Useful if command is running slow.
--skip-md5
Skip MD5 hash calculation. Useful if command is running slow.
ENCRYPTION FLAGS
--decryption-keys=[DECRYPTION_KEY,…]
A comma-separated list of customer-supplied encryption keys (RFC 4648 section 4 base64-encoded AES256 strings) that will be used to decrypt Cloud Storage objects. Data encrypted with a customer-managed encryption key (CMEK) is decrypted automatically, so CMEKs do not need to be listed here.
GCLOUD WIDE FLAGS
These flags are available to all commands: --access-token-file, --account, --billing-project, --configuration, --flags-file, --flatten, --format, --help, --impersonate-service-account, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity.

Run $ gcloud help for details.

NOTES
This command is currently in alpha and might change without notice. If this command fails with API permission errors despite specifying the correct project, you might be trying to access an API with an invitation-only early access allowlist. This variant is also available:
gcloud storage hash