tencent cloud

Feedback

Getting File Hash Value - hash

Last updated: 2024-01-06 16:15:34
    The hash command is used to calculate the hash value of a local file or get the hash value of a file in COS.

    Command Syntax

    ./coscli hash <object-name> [flag]
    hash includes the following parameters:
    Parameter Format
    Description
    Example
    <object-name>
    Specifies the target file, which can be a local path or a COS file path. The COS path is accessible by using the bucket alias or bucket name configured in the configuration file as detailed in Download and Installation Configuration. If you use the bucket name for access, you also need to include the endpoint flag.
    Local path: ~/example.txt
    COS file path specified with the bucket alias: cos://bucketalias/example.txt
    COS file path specified with the bucket name: cos://examplebucket-1250000000/example.txt
    The hash command contains the following optional flags:
    Flag Abbreviation
    Flag Name
    Description
    -h
    --help
    Views the usage of this command.
    None
    --type
    Hash type, which can be MD5 or CRC64 (default)
    Note:
    For other common options of this command (such as switching bucket and user account), see Common Options.

    Examples

    Calculating the CRC64 value of local file

    ./coscli hash ~/test.txt

    Getting the MD5 value of COS file

    ./coscli hash cos://bucket1/example.txt --type=md5
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support