CLDSRV-902: calculate final checksum from parts#6169
Conversation
|
LGTM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
... and 1 file with indirect coverage changes @@ Coverage Diff @@
## development/9.4 #6169 +/- ##
===================================================
+ Coverage 85.21% 85.29% +0.08%
===================================================
Files 207 208 +1
Lines 13832 13917 +85
===================================================
+ Hits 11787 11871 +84
- Misses 2045 2046 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Hello leif-scality,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
| @@ -0,0 +1,185 @@ | |||
| 'use strict'; | |||
There was a problem hiding this comment.
not needed anymore
| const buf = Buffer.from(b64, 'base64'); | ||
| let r = 0n; | ||
| for (let i = 0; i < buf.length; i += 1) { | ||
| r = (r << 8n) | BigInt(buf[i]); | ||
| } | ||
| return r; |
There was a problem hiding this comment.
You could convert to a BigInt one-shot like that (I think it's actually quite efficient, possibly more than converting one byte at a time):
| const buf = Buffer.from(b64, 'base64'); | |
| let r = 0n; | |
| for (let i = 0; i < buf.length; i += 1) { | |
| r = (r << 8n) | BigInt(buf[i]); | |
| } | |
| return r; | |
| const buf = Buffer.from(b64, 'base64'); | |
| return BigInt(`0x${buf.toString('hex')}`); |
| const nBytes = dim / 8; | ||
| const buf = Buffer.alloc(nBytes); | ||
| let v = value; | ||
| for (let i = nBytes - 1; i >= 0; i -= 1) { | ||
| buf[i] = Number(v & 0xffn); | ||
| v >>= 8n; | ||
| } | ||
| return buf.toString('base64'); |
There was a problem hiding this comment.
Likewise, this could be done one-shot over the whole bigint
| const nBytes = dim / 8; | |
| const buf = Buffer.alloc(nBytes); | |
| let v = value; | |
| for (let i = nBytes - 1; i >= 0; i -= 1) { | |
| buf[i] = Number(v & 0xffn); | |
| v >>= 8n; | |
| } | |
| return buf.toString('base64'); | |
| const unpaddedHex = value.toString(16); | |
| const paddedHex = unpaddedHex.padStart(dim / 4, '0'); | |
| return Buffer.from(paddedHex, 'hex').toString('base64'); |
8754b9a to
2493909
Compare
|
LGTM |
2493909 to
538c16c
Compare
|
LGTM |
|
ping |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
|
/approve |
|
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
Please check the status of the associated issue CLDSRV-902. Goodbye leif-scality. The following options are set: approve |
Uh oh!
There was an error while loading. Please reload this page.