Skip to content

Commit e351e73

Browse files
committed
Update tests to test with Unicode
1 parent fea07e6 commit e351e73

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/node.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ var encodings = ['binary', 'hex', 'base64'];
2222
algorithms.forEach(function (algorithm) {
2323
encodings.forEach(function (encoding) {
2424
assertSame(algorithm + ' hash using ' + encoding, function (crypto, cb) {
25-
cb(null, crypto.createHash(algorithm).update('hello', 'utf-8').digest(encoding));
25+
cb(null, crypto.createHash(algorithm).update('hellø', 'utf-8').digest(encoding));
2626
})
2727

2828
assertSame(algorithm + ' hmac using ' + encoding, function (crypto, cb) {
29-
cb(null, crypto.createHmac(algorithm, 'secret').update('hello', 'utf-8').digest(encoding))
29+
cb(null, crypto.createHmac(algorithm, 'secret').update('hellø', 'utf-8').digest(encoding))
3030
})
3131
});
3232

3333
assertSame(algorithm + ' with raw binary', function (crypto, cb) {
34-
var seed = 'hello';
34+
var seed = 'hellø';
3535
for (var i = 0; i < 1000; i++) {
36-
seed = crypto.createHash(algorithm).update(seed).digest('binary');
36+
seed = crypto.createHash(algorithm).update(new Buffer(seed)).digest('binary');
3737
}
38-
cb(null, crypto.createHash(algorithm).update(seed).digest('hex'));
38+
cb(null, crypto.createHash(algorithm).update(new Buffer(seed)).digest('hex'));
3939
});
4040

4141
assertSame(algorithm + ' empty string', function (crypto, cb) {

0 commit comments

Comments
 (0)