@@ -453,8 +453,9 @@ test('Custom 64 chars', t => {
453453 let charSet = entropy . charSet64
454454 try {
455455 charSet . use ( 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ9876543210_-' )
456- let string = entropy . randomStringWithBytes ( 72 , charSet ,
457- [ 0x9d , 0x99 , 0x4e , 0xa5 , 0xd2 , 0x3f , 0x8c , 0x86 , 0x80 ] )
456+ let bytes = [ 0x9d , 0x99 , 0x4e , 0xa5 , 0xd2 , 0x3f , 0x8c , 0x86 , 0x80 ]
457+ let string = entropy . randomString ( 72 , charSet , bytes )
458+
458459 t . is ( string , 'NzLoPDi-JiAa' )
459460 }
460461 catch ( error ) {
@@ -470,8 +471,7 @@ test('Custom 32 chars', t => {
470471 let charSet = entropy . charSet32
471472 try {
472473 charSet . use ( '2346789BDFGHJMNPQRTbdfghjlmnpqrt' )
473- let string = entropy . randomStringWithBytes ( 55 , charSet ,
474- [ 0xd2 , 0xe3 , 0xe9 , 0xda , 0x19 , 0x97 , 0x52 ] )
474+ let string = entropy . randomString ( 55 , charSet , [ 0xd2 , 0xe3 , 0xe9 , 0xda , 0x19 , 0x97 , 0x52 ] )
475475 t . is ( string , 'mHRrbgQlTqF' )
476476 }
477477 catch ( error ) {
@@ -487,7 +487,7 @@ test('Custom 16 chars', t => {
487487 let charSet = entropy . charSet16
488488 try {
489489 charSet . use ( '0123456789ABCDEF' )
490- let string = entropy . randomStringWithBytes ( 20 , charSet , [ 0xc7 , 0xc9 , 0x00 ] )
490+ let string = entropy . randomString ( 20 , charSet , [ 0xc7 , 0xc9 , 0x00 ] )
491491 t . is ( string , 'C7C90' )
492492 }
493493 catch ( error ) {
@@ -503,7 +503,7 @@ test('Custom 8 chars', t => {
503503 let charSet = entropy . charSet8
504504 try {
505505 charSet . use ( 'abcdefgh' )
506- let string = entropy . randomStringWithBytes ( 30 , charSet , [ 0xc7 , 0xc9 , 0x07 , 0xc9 ] )
506+ let string = entropy . randomString ( 30 , charSet , [ 0xc7 , 0xc9 , 0x07 , 0xc9 ] )
507507 t . is ( string , 'gbheeeahgc' )
508508 }
509509 catch ( error ) {
@@ -519,7 +519,7 @@ test('Custom 4 chars', t => {
519519 let charSet = entropy . charSet4
520520 try {
521521 charSet . use ( 'atcg' )
522- let string = entropy . randomStringWithBytes ( 16 , charSet , [ 0x20 , 0xf1 ] )
522+ let string = entropy . randomString ( 16 , charSet , [ 0x20 , 0xf1 ] )
523523 t . is ( string , 'acaaggat' )
524524 }
525525 catch ( error ) {
@@ -535,7 +535,7 @@ test('Custom 2 chars', t => {
535535 let charSet = entropy . charSet2
536536 try {
537537 charSet . use ( 'HT' )
538- let string = entropy . randomStringWithBytes ( 16 , charSet , [ 0xe3 , 0xe9 ] )
538+ let string = entropy . randomString ( 16 , charSet , [ 0xe3 , 0xe9 ] )
539539 t . is ( string , 'TTTHHHTTTTTHTHHT' )
540540 }
541541 catch ( error ) {
0 commit comments