mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-24 22:25:48 +00:00
Transaction#hash.
This commit is contained in:
@@ -216,13 +216,16 @@ SerializedObject.prototype.serialize = function (typedef, obj) {
|
||||
}
|
||||
};
|
||||
|
||||
SerializedObject.prototype.signing_hash = function (prefix) {
|
||||
SerializedObject.prototype.hash = function (prefix) {
|
||||
var sign_buffer = new SerializedObject();
|
||||
stypes.Int32.serialize(sign_buffer, prefix);
|
||||
sign_buffer.append(this.buffer);
|
||||
return sign_buffer.hash_sha512_half();
|
||||
};
|
||||
|
||||
// DEPRECATED
|
||||
SerializedObject.prototype.signing_hash = SerializedObject.prototype.hash;
|
||||
|
||||
SerializedObject.prototype.hash_sha512_half = function () {
|
||||
var bits = sjcl.codec.bytes.toBits(this.buffer);
|
||||
var hash = sjcl.bitArray.bitSlice(sjcl.hash.sha512.hash(bits), 0, 256);
|
||||
|
||||
Reference in New Issue
Block a user