import { customAlphabet } from 'nanoid';
export const epochTime = (date = Date.now()) => Math.floor(date / 1000);
export const unmarshallProtobufAny = (msg) => {
    if (msg?.value) {
        return JSON.parse(msg.value.toString());
    }
};
export const marshallProtobufAny = (payload) => {
    return {
        typeUrl: '',
        value: Buffer.from(JSON.stringify(payload))
    };
};
const generate = customAlphabet('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-', 21);
export const nanoid = () => {
    return generate();
};
//# sourceMappingURL=utils.js.map