Skip to content

Commit fce5e8b

Browse files
author
Mr. Angry
committed
FAB-221: Add the SJCL bytes codec at SJCL v1.0.3
Adding the SJCL codec package based off of SJCL v1.0.3. This includes the bytes codec necessary for hash.js. Change-Id: Icc8a6ded8bfecca9b1cc329e55c0ee9cf31716d8 Signed-off-by: Anna D Derbakova <adderbak@us.ibm.com>
1 parent 061e064 commit fce5e8b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

sdk/node/lib/hash.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* NOTE: This is in pure java script to be compatible with the sjcl.hmac function.
2626
*/
2727
var sjcl = require('sjcl');
28+
var sjcl_codec = require('sjcl-codec');
2829
var jssha = require('jssha');
2930
var sha3_256 = require('js-sha3').sha3_256;
3031
var sha3_384 = require('js-sha3').sha3_384;
@@ -148,7 +149,7 @@ hash_sha3_384.prototype = {
148149
* @return {bytes} the bytes converted from the bitArray
149150
*/
150151
bitsToBytes = function (bits) {
151-
return sjcl.codec.bytes.fromBits(bits);
152+
return sjcl_codec.bytes.fromBits(bits);
152153
}
153154

154155
/**
@@ -157,7 +158,7 @@ bitsToBytes = function (bits) {
157158
* @return {bitArray} the bitArray converted from bytes
158159
*/
159160
bytesToBits = function (bytes) {
160-
return sjcl.codec.bytes.toBits(bytes);
161+
return sjcl_codec.bytes.toBits(bytes);
161162
}
162163

163164
exports.hash_sha3_256 = hash_sha3_256;

sdk/node/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"node.extend": "^1.1.5",
2424
"pkijs": "^1.3.19",
2525
"sjcl": "^1.0.3",
26+
"sjcl-codec": "^0.1.1",
2627
"sleep": "^3.0.1",
2728
"tar-fs": "^1.13.0",
2829
"url": "^0.11.0",

0 commit comments

Comments
 (0)