Created
September 9, 2015 16:56
-
-
Save genecyber/da6e11c7d4588eb19a88 to your computer and use it in GitHub Desktop.
To DoubleSha256 or Scrypt in bitcore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BlockHeader.prototype._getHash = function hash() { | |
var buf = this.toBuffer(); | |
//console.log("version",this.version, "is it?",this.version === 514 ) | |
//console.log("Scrypt",BufferUtil.reverse(BufferUtil.scrypt(buf)).toString('hex'))//.reverse(buf.read(80)).toString('hex')) | |
if (this.version === 514) { | |
return BufferUtil.reverse(BufferUtil.reverse(BufferUtil.scrypt(buf))) | |
} else { | |
return Hash.sha256sha256(buf); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment