Uh oh!
There was an error while loading. Please reload this page.
4117: Added Md5String() method and updated tests. - #4397
Conversation
andrey-qlogic
commented
Jan 21, 2019
@frankyn, would you please take a look at this PR. |
frankyn
left a comment
There was a problem hiding this comment.
@andrey-qlogic adding this feature to the client sg. I recommend adding the same for crc32c as well.
andrey-qlogic
commented
Jan 23, 2019
Added Crc32cString() method and updated tests. Added to snippets. |
frankyn
commented
Jan 24, 2019
Hi @andrey-qlogic, Thanks for the update. I chatted with the GCS team about this design. It sounds good to them but suggested adding a Hex Hash String to GCS base64 encoded string for setCrc32c() method to the The naming convention would help: @googleapis/yoshi-java do you have input on Java community method names? WDYT about the following names? getMd5ToHexString()
setMd5FromHexString()
getCrc32cToHexString()
setCrc32cFromHexString() |
…, getCrc32cToHexString()
Renamed new methods using naming convention getMd5ToHexString(), getCrc32cToHexString(). |
frankyn
commented
Jan 31, 2019
The other method setMd5 for example expects the base64 encoded string of an Md5 hash. It would be nice to have a similar helper method to getting the md5 hash as a base64 decoded md5 hex string. |
andrey-qlogic
commented
Feb 1, 2019
@frankyn, that is unclear, are you suggesting to add a new setter method to class BuilderImpl and assign it to md5 ? Otherwise the method getMd5ToHexString is implepented for BlobInfo class in 85588a3 I would appreciate for your input |
I'm expecting to see // pseudo codesetMd5FromHexString(Stringmd5HexString) {
// convert md5HexString back to its binary representation e.g. reverse binary to human readable hex.// base64 encode the binary representation// set the value of Md5 in BlobInfo to the base64 encoded version.
} |
andrey-qlogic
commented
Feb 4, 2019
Added methods to set Md2 and Crc32s from hex strings. |
andrey-qlogic
commented
Feb 4, 2019
there are code format issues that will be fixed with #4437 |
Uh oh!
There was an error while loading. Please reload this page.
andrey-qlogic
commented
Feb 6, 2019
@frankyn, I realized that Md5 sometimes used with 0x prefix that can be easily removed at BlobInfo class. |
frankyn
commented
Feb 7, 2019
For this PR, @andrey-qlogic could you skip supporting the removal of "0x" for now? Thank you, apologies for constant delays on these reviews. |
andrey-qlogic
commented
Feb 7, 2019
frankyn
commented
Feb 7, 2019
Yes except the integration test. |
andrey-qlogic
commented
Feb 7, 2019
Reverted back the commit 7f19e33 except integration tests. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
andrey-qlogic
commented
Feb 7, 2019
@frankyn, do you mean the change for both Md5 and Crc32c, correct |
… prepending 0x. OmitPadding removed
@frankyn |
frankyn
left a comment
There was a problem hiding this comment.
I think this is the last nits. Thanks for your patience @andrey-qlogic.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
andrey-qlogic
commented
Feb 8, 2019
@frankyn , I realized that new BigInteger(md5HexString, 16).toByteArray() is not safe with leading zeros. I changed to DatatypeConverter.parseHexBinary(md5HexString). It works fine. If needed we can make an utility method instead. |
frankyn
left a comment
There was a problem hiding this comment.
LGTM, I notice you dropped, DatatypeConverter.parseHexBinary(md5HexString) due to supportability. Thanks for verifying that!
andrey-qlogic
commented
Feb 11, 2019
thanks for the approval |
Fixes#4117