11var tape = require ( 'tape' )
22var Hash = require ( '../hash' )
3-
43var hex = '0A1B2C3D4E5F6G7H'
54
65function equal ( t , a , b ) {
76 t . equal ( a . length , b . length )
87 t . equal ( a . toString ( 'hex' ) , b . toString ( 'hex' ) )
98}
109
11- var hexBuf = new Buffer ( '0A1B2C3D4E5F6G7H' , 'utf8' )
10+ var hexBuf = Buffer . from ( '0A1B2C3D4E5F6G7H' , 'utf8' )
1211var count16 = {
1312 strings : [ '0A1B2C3D4E5F6G7H' ] ,
1413 buffers : [
1514 hexBuf ,
16- new Buffer ( '80000000000000000000000000000080' , 'hex' )
15+ Buffer . from ( '80000000000000000000000000000080' , 'hex' )
1716 ]
1817}
1918
2019var empty = {
2120 strings : [ '' ] ,
2221 buffers : [
23- new Buffer ( '80000000000000000000000000000000' , 'hex' )
22+ Buffer . from ( '80000000000000000000000000000000' , 'hex' )
2423 ]
2524}
2625
2726var multi = {
2827 strings : [ 'abcd' , 'efhijk' , 'lmnopq' ] ,
2928 buffers : [
30- new Buffer ( 'abcdefhijklmnopq' , 'ascii' ) ,
31- new Buffer ( '80000000000000000000000000000080' , 'hex' )
29+ Buffer . from ( 'abcdefhijklmnopq' , 'ascii' ) ,
30+ Buffer . from ( '80000000000000000000000000000080' , 'hex' )
3231 ]
3332}
3433
@@ -37,14 +36,14 @@ var long = {
3736 buffers : [
3837 hexBuf ,
3938 hexBuf ,
40- new Buffer ( '80000000000000000000000000000100' , 'hex' )
39+ Buffer . from ( '80000000000000000000000000000100' , 'hex' )
4140 ]
4241}
4342
4443function makeTest ( name , data ) {
4544 tape ( name , function ( t ) {
4645 var h = new Hash ( 16 , 8 )
47- var hash = new Buffer ( 20 )
46+ var hash = Buffer . alloc ( 20 )
4847 var n = 2
4948 var expected = data . buffers . slice ( )
5049 // t.plan(expected.length + 1)
0 commit comments