Skip to content

Commit bc593db

Browse files
committed
switch to safe-buffer
1 parent d1088bf commit bc593db

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@
3232
"timing-safe-equal": "^1.0.0"
3333
},
3434
"devDependencies": {
35-
"buffer-shims": "^1.0.0",
3635
"hash-test-vectors": "~1.3.2",
3736
"pseudorandombytes": "^2.0.0",
37+
<<<<<<< HEAD
3838
"safe-buffer": "^5.1.1",
39+
=======
40+
"safe-buffer": "^5.1.2",
41+
>>>>>>> switch to safe-buffer
3942
"standard": "^5.0.2",
4043
"tape": "~2.3.2",
4144
"zuul": "^3.6.0"

test/timing-safe-equal.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
var test = require('tape')
22
var timingSafeEqual = require('timing-safe-equal/browser')
3-
var bufferShims = require('buffer-shims')
3+
var Buffer = require('safe-buffer').Buffer
44
test('timingSafeEqual', function (t) {
55
t.plan(5)
66
t.strictEqual(
7-
timingSafeEqual(bufferShims.from('foo'), bufferShims.from('foo')),
7+
timingSafeEqual(Buffer.from('foo'), Buffer.from('foo')),
88
true,
99
'should consider equal strings to be equal'
1010
)
1111

1212
t.strictEqual(
13-
timingSafeEqual(bufferShims.from('foo'), bufferShims.from('bar')),
13+
timingSafeEqual(Buffer.from('foo'), Buffer.from('bar')),
1414
false,
1515
'should consider unequal strings to be unequal'
1616
)
1717

1818
t.throws(function () {
19-
timingSafeEqual(bufferShims.from([1, 2, 3]), bufferShims.from([1, 2]))
19+
timingSafeEqual(Buffer.from([1, 2, 3]), Buffer.from([1, 2]))
2020
}, 'should throw when given buffers with different lengths')
2121

2222
t.throws(function () {
23-
timingSafeEqual('not a buffer', bufferShims.from([1, 2]))
23+
timingSafeEqual('not a buffer', Buffer.from([1, 2]))
2424
}, 'should throw if the first argument is not a buffer')
2525

2626
t.throws(function () {
27-
timingSafeEqual(bufferShims.from([1, 2]), 'not a buffer')
27+
timingSafeEqual(Buffer.from([1, 2]), 'not a buffer')
2828
}, 'should throw if the second argument is not a buffer')
2929
})

0 commit comments

Comments
 (0)