Skip to content
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

Continuous hashing #252

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Next

storage: doc

  • Loading branch information
astro committed Jan 21, 2015
commit 9e74b016116695e385294320d1be3d13693bb0ba
@@ -125,6 +125,7 @@ Piece.prototype._reset = function () {
self.blocksWritten = 0
}

// called by writeBlock() once all blocks have been written
Piece.prototype.verify = function (buffer) {
var self = this
buffer = buffer || self.buffer
@@ -155,6 +156,7 @@ Piece.prototype.verify = function (buffer) {
}
}

// validates a readBlock()/writeBlock() offset
Piece.prototype._verifyOffset = function (offset) {
var self = this
if (offset % BLOCK_LENGTH === 0) {
@@ -165,6 +167,7 @@ Piece.prototype._verifyOffset = function (offset) {
}
}

// validates a writeBlock() buffer length
Piece.prototype._verifyBlock = function (offset, buffer) {
var self = this
if (buffer.length === BLOCK_LENGTH) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.