MCPcopy Create free account
hub / github.com/bajrangCoder/setu / base64_encode

Function base64_encode

src/utils/curl_parser.rs:362–389  ·  view source on GitHub ↗

Minimal RFC 4648 base64 encoder (no external dependency).

(input: &[u8])

Source from the content-addressed store, hash-verified

360 }
361 }
362 _ => current.push('\\'),
363 }
364 }
365 }
366 _ => current.push(c),
367 },
368 }
369 }
370
371 if !matches!(quote, Quote::None) {
372 return Err("Unterminated quote in curl command".into());
373 }
374 if in_token {
375 tokens.push(current);
376 }
377
378 Ok(tokens)
379}
380
381#[cfg(test)]
382mod tests {
383 use super::*;
384
385 #[test]
386 fn detects_curl_prefix() {
387 assert!(looks_like_curl("curl https://example.com"));
388 assert!(looks_like_curl(" curl https://example.com"));
389 assert!(!looks_like_curl("https://example.com"));
390 assert!(!looks_like_curl("curlhttps://example.com"));
391 }
392

Callers 1

parse_curlFunction · 0.70

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected