Skip to main content

create_backend_req_id

Function create_backend_req_id 

Source
pub fn create_backend_req_id(acc_id: u64) -> String
Expand description

Create C++-shaped backend MsgHeader.req_id.

Ref:

  • /Users/leaf/ai-lab/o-src/FutuOpenD/Src/NNProtoCenter/Trade/_NNProto_Trd_Comm.cpp:9-23
  • /Users/leaf/ai-lab/o-src/FutuOpenD/Src/NNProtoCenter/NNProtoCenter_Inner_Macro_Send.h:16-24
  • proto-internal/odr_sys_cmn.proto:819-824

C++ packs 8 bytes of hash plus a 16-byte random unique id, base64-encodes the 24 bytes into 32 chars, then overwrites the first bytes with OD|. Rust uses local time plus random data in the hash seed because gateway translators do not carry the login server-time clock; uniqueness and the OpenD/base64 wire shape are the backend contract here.