Skip to main content

base64_encode

Function base64_encode 

Source
pub fn base64_encode(data: &[u8]) -> String
Expand description

Standard base64 with padding, matching what BytesCoder accepts (MongoTransform.js:1306). Hand-rolled to keep parse-rust-core dependency-light; it is 20 lines and the alphabet is fixed by the wire format. Base64, as the {"__type":"Bytes","base64":...} envelope spells it.

Public because the Mongo adapter needs the same spelling when it stores a value verbatim: schema metadata and query atoms both keep a Bytes in envelope form rather than as BSON Binary.