Skip to content

Commit 481cae9

Browse files
sibeliuskassens
authored andcommitted
use Buffer.from instead of new Buffer (#181)
fixes #180
1 parent f71fa25 commit 481cae9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/base64.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
export type Base64String = string;
1212

1313
export function base64(i: string): Base64String {
14-
return new Buffer(i, 'utf8').toString('base64');
14+
return Buffer.from(i, 'utf8').toString('base64');
1515
}
1616

1717
export function unbase64(i: Base64String): string {
18-
return new Buffer(i, 'base64').toString('utf8');
18+
return Buffer.from(i, 'base64').toString('utf8');
1919
}

0 commit comments

Comments
 (0)