简体   繁体   English

寿命有多长

[英]How to long is urn life

how long does I get urn in my code on derivativesApi 我的衍生品代码中的骨灰long多久了

Autodesk.Forge.Model.DynamicJsonResponse translateResponse = derivativesApi.Translate(job, true); Autodesk.Forge.Model.DynamicJsonResponse translationResponse =衍生物Api.Translate(job,true); string responseUrn = translateResponse.Dictionary["urn"].ToString(); 字符串responseUrn = translationResponse.Dictionary [“ urn”]。ToString();

I guess you're asking the string length of the base64 urn. 我猜您在问base64骨灰盒的字符串长度。

It depends on the characters of the objectId (aka object urn returned by PUT /buckets/:bucketKey/objects/:objectName ) you passed into the base64 string encoder with my experience, and it will be the same urn you pass to the POST job of the Forge Model Derivative API. 它取决于您根据我的经验传递给base64字符串编码器的objectId的字符(又名PUT / buckets /:bucketKey / objects /:objectName返回的对象urn),并且与传递给POST作业的对象相同的Forge Model Derivative API。 Normally, each Base64 digit represents exactly 6 bits of data from the wiki and here is a formula to calculate the encoded string length link : 通常,每个Base64数字代表Wiki中的 6位数据,这是计算编码的字符串长度链接的公式:

((4 * n / 3) + 3) & ~3

note1. 注1。 n is the string length of your objectId . n是您的objectId的字符串长度。

For instance, the length of the urn:adsk.objects:os.object:mybucket/example.txt is 47. After base64 encoding, the result dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bXlidWNrZXQvZXhhbXBsZS50eHQ= length is ((4 * 47 / 3) + 3) & ~3 = 64 . 例如, urn:adsk.objects:os.object:mybucket/example.txt长度为47。经过base64编码后,结果dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bXlidWNrZXQvZXhhbXBsZS50eHQ=长度为((4 * 47 / 3) + 3) & ~3 = 64

note2. 笔记2。 The padding character = must be removed while triggering Forge translation jobs manually, Forge Model Derivative API doesn't allow it. 手动触发Forge翻译作业时,必须删除填充字符= ,Forge Model Derivative API不允许这样做。 Here is the formula: 这是公式:

len of the urn = 64 - n of the padding character `=`

Therefore, the final string length of the urn you obtain from the API response is 64 - 1 = 63 . 因此,您从API响应中获得的urn的最终字符串长度为64-1 64 - 1 = 63

Ref. 参考。 https://en.wikipedia.org/wiki/Base64 https://en.wikipedia.org/wiki/Base64

note3. 注3。 Unless you call DELETE :urn/manifest to deleted the translated results (akaviewable bubbles), viewable bubbles will be stored in Forge server permanently. 除非您调用DELETE:urn / manifest删除翻译的结果(可见气泡),否则可见气泡将永久存储在Forge服务器中。 You can also use viewable bubbles' urn to access them, despite the model file stored in your managed OSS bucket is deleted by the bucket policy you have set up. 尽管已设置的存储桶策略删除了存储在托管OSS存储桶中的模型文件,但您也可以使用可见的气泡缸来访问它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM