1
0
Fork 0
mirror of https://github.com/imjasonh/gcloud-help synced 2026-07-08 18:45:13 +00:00
gcloud-help/gcloud/storage/hash
2023-09-07 10:42:28 +00:00

73 lines
2.6 KiB
Text

NAME
gcloud storage hash - calculates hashes on local or cloud files
SYNOPSIS
gcloud storage hash URLS [URLS ...] [--additional-headers=HEADER=VALUE]
[--hex] [--skip-crc32c | --skip-md5]
[--decryption-keys=[DECRYPTION_KEY,...]] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
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 storage hash gs://bucket/object
To get just the MD5 hash digest of a local object in hex format:
$ gcloud storage hash /dir/object.txt --skip-md5 --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 variant is also available:
$ gcloud alpha storage hash