protocolbuffers / protocolbuffers/protobuf-javascript

How to serialize object make the output the same as SerializeAsString() method of C++

Open
#167 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
JavaScript
Stars
471
Forks
91
Avg merge
3h 57m
Merged PRs (30d)
2

Description

In C++, I can call protobuf_object.SerializeAsString().
Which method is the same as above in nodejs?
The following code is not correct.

            let out = pbObj.serializeBinary();
            let serializeStr = Buffer.from(out).toString();

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the mentioned pbObj.serializeBinary() entry point and inspect how its returned value is represented in Node.js. Compare that value with the bytes produced by C++ SerializeAsString(); done means identifying the supported JavaScript representation that preserves the same serialized protobuf bytes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.