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 #250

Merged
merged 6 commits into from Jan 21, 2015
Merged
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

storage: doc

  • Loading branch information
astro committed Jan 21, 2015
commit a9379e11ac96915046c8164d70fa01c88f39a727
@@ -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.