mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
12 lines
308 B
TypeScript
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');
|
|
}
|