-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: restore part #1
base: master
Are you sure you want to change the base?
Conversation
for both js and java GF256 interpolation can take optional partIdx param that can be used to recreate part at that index Scheme class gets restorePart idx to restore lost or corrupted part from minimu required original parts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great job!
src/main/js/Scheme.js
Outdated
const lengths = Object.values(parts).map(x => x.length); | ||
const max = Math.max.apply(null, lengths); | ||
const min = Math.min.apply(null, lengths); | ||
if (max !== min) {`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant ``
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -126,6 +128,35 @@ void splitAndJoinInquorate() { | |||
}); | |||
} | |||
|
|||
@Test | |||
void restorePartRoundtrip() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, nice! how do you execute these tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mvn test
but i don't have maven localy installed
maven is gradle's predecessor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
src/test/js/SchemeTests.js
Outdated
const partsToRestoreFrom = { '1': splits['1'], '2': splits['2'] }; | ||
const restoredPart = restorePart(partsToRestoreFrom, 3); | ||
const splitsWithRestored = {'1': splits['1'], '3': restoredPart}; | ||
const joined = bytesToSring(join(splitsWithRestored)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add ;
please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
for both js and java
GF256 interpolation can take optional partIdx param that can be used to recreate part at that index
Scheme class gets restorePart idx to
restore lost or corrupted part from
minimum required original parts