Files
blitzkit/packages/core/src/protobuf/encodeProtobufToBase64.ts
T
2024-09-06 23:17:53 -05:00

12 lines
308 B
TypeScript

import { encodeProtobuf } from './encodeProtobuf';
import { ProtoSource } from './lookupProtobufType';
export async function encodeProtobufToBase64(
source: ProtoSource,
type: string,
data: any,
) {
const array = encodeProtobuf(source, type, data);
return Buffer.from(array).toString('base64');
}