如何在Google Storage Transfer上创建tsv文件 [英] How to create a tsv file on Google Storage Transfer

查看:288
本文介绍了如何在Google Storage Transfer上创建tsv文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google为他们的云服务提供了很好的文档,但不幸的是没有人能理解其中的内容.
他们的解释总是跳来跳去,使人们毫无头绪就可以完成简单的任务.

Google provide a great documentation for their cloud services, but unfortunately nobody can understand the content.
Their explanation always jumping and leave people with no clue to accomplish even a simple task.

创建tsv文件应该是一个简单的任务.

Creating tsv file should be a simple task.

我试图遵循此页面中的所有内容创建URL列表,但停留在未知错误"日志中. 未知错误表示我永远不知道自己在做什么.

I tried to follow everything in this page Creating a URL List but stuck with "unknown error" log. Unknown error means I never know what I am doing wrong.

他们给示例下载文件md5-test一个字符串"Storage Transfer MD5 Test" => BfnRTwvHpofMOn2Pq7EVyQ ==

They gave example downloaded file md5-test a string "Storage Transfer MD5 Test" => BfnRTwvHpofMOn2Pq7EVyQ==

我可以使用

`openssl md5 -binary md5-test | openssl enc -base64`

获取哈希"BfnRTwvHpofMOn2Pq7EVyQ =="

to get hash "BfnRTwvHpofMOn2Pq7EVyQ=="

这是否意味着存储传输MD5测试"的哈希为"BfnRTwvHpofMOn2Pq7EVyQ ==?

Is it mean the hash for "Storage Transfer MD5 Test" is "BfnRTwvHpofMOn2Pq7EVyQ==" ?

他们在示例代码中给出了不同的字符串:

They gave different string in their example code:

TsvHttpData-1.0
https://example.com/buckets/obj1 1357 wHENa08V36iPYAsOa2JAdw == https://example.com/buckets/obj2 2468 R9acAaveoPd2y8nniLUYbw ==

TsvHttpData-1.0
https://example.com/buckets/obj1 1357 wHENa08V36iPYAsOa2JAdw== https://example.com/buckets/obj2 2468 R9acAaveoPd2y8nniLUYbw==

不匹配,不知道应该对哪个对象进行编码?
他们为什么不给下载文件内容和示例代码一样?

It is not match, and leave me with no clue which object should be encoded?
Why don't they just gave the download file content the same with the example code?

哪个字符串将生成"wHENa08V36iPYAsOa2JAdw ==?

What string will generate "wHENa08V36iPYAsOa2JAdw==" ?

我试图将示例代码的每个部分放入md5-test文件中并运行openssl md5 -binary md5-test | openssl enc -base64,但无法获取该示例哈希.

I have tried to put every part of the example code in the md5-test file and run openssl md5 -binary md5-test | openssl enc -base64 but can not get that example hash.

推荐答案

md5-test文件用于验证您可以正确生成md5哈希.由于从此文件中获取了正确的md5哈希BfnRTwvHpofMOn2Pq7EVyQ==,因此都可以生成Base64编码的MD5哈希.

The md5-test file is used to verify that you can generate md5 hashes correctly. Since you're getting the correct md5 hash BfnRTwvHpofMOn2Pq7EVyQ== from this file, you're all set for generating Base64-encoded MD5 hashes.

现在,您需要通过在本地运行以下命令为要包含在TSV文件中的每个文件生成一个文件:

Now you'll need to generate one for each file you'd like to include in your TSV file by running locally the following command:

openssl md5 -binary <your_file_name> | openssl enc -base64

,这将为每个文件提供一个新的Base64编码的MD5哈希.然后,您可以将文件上载到最终目的地,并相应地创建TSV文件.以文档中提供的示例为例, d要在您的网址列表中包含md5-test文件,则生成的TSV文件将如下所示:

which will give you a new Base64-encoded MD5 hash for each file. You can then upload the files to their final destination and create the TSV file accordingly. To take the example provided in the documentation, and let's say you'd like to include the md5-test file in your URL list, the resulting TSV file would look like this:

TsvHttpData-1.0
https://storage.googleapis.com/md5-test/md5-test 26 BfnRTwvHpofMOn2Pq7EVyQ == https://example.com/buckets/obj1 1357 wHENa08V36iPYAsOa2JAdw == https://example.com/buckets/obj2 2468 R9acAaveoPd2y8nniLUYbw ==

TsvHttpData-1.0
https://storage.googleapis.com/md5-test/md5-test 26 BfnRTwvHpofMOn2Pq7EVyQ== https://example.com/buckets/obj1 1357 wHENa08V36iPYAsOa2JAdw== https://example.com/buckets/obj2 2468 R9acAaveoPd2y8nniLUYbw==

这篇关于如何在Google Storage Transfer上创建tsv文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆