mirror of
https://github.com/emn178/js-sha3.git
synced 2026-08-12 19:41:36 +08:00
- Added TypeScript definitions.
- Changed throw error if update after finalize
This commit is contained in:
+11
-1
@@ -264,7 +264,7 @@
|
||||
call: function (message) {
|
||||
var hash = algorithm.update(message);
|
||||
hash.hex();
|
||||
hash.update(message);
|
||||
hash.finalize();
|
||||
return hash.hex();
|
||||
}
|
||||
}
|
||||
@@ -321,6 +321,16 @@
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
context('when update after finalize', function () {
|
||||
it('should throw error', function () {
|
||||
expect(function () {
|
||||
var hash = algorithm.update('any');
|
||||
hash.hex();
|
||||
hash.update('any');
|
||||
}).to.throwError(/finalize already called/);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user