Skip to main content

upload.getCdnFileHashes

Get SHA256 hashes for verifying downloaded CDN files

func (c *Client) UploadGetCDNFileHashes(ctx context.Context, request *UploadGetCDNFileHashesRequest) ([]FileHash, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.UploadGetCDNFileHashes(ctx, &tg.UploadGetCDNFileHashesRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // []FileHash
return nil
})

Parameters

NameTypeRequiredDescription
FileToken[]byteyesFile
Offsetint64yesOffset from which to start getting hashes

Returns

[]FileHash

Possible errors

CodeTypeDescription
400CDN_METHOD_INVALIDYou can't call this method in a CDN DC.
400FILE_TOKEN_INVALIDThe master DC did not accept the file_token (e.g., the token has expired). Continue downloading the file from the master DC using upload.getFile.
400RSA_DECRYPT_FAILEDInternal RSA decryption failed.

References