mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
refactor: common to ts
This commit is contained in:
6
src/common/libs/bufferToBase64.ts
Normal file
6
src/common/libs/bufferToBase64.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export function bufferToBase64 (buf: Buffer) {
|
||||
const binstr = Array.prototype.map.call(buf, ch => {
|
||||
return String.fromCharCode(ch);
|
||||
}).join('');
|
||||
return Buffer.from(binstr, 'base64');
|
||||
}
|
Reference in New Issue
Block a user