MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / base64_decode

Function base64_decode

native/shared/src/models.rs:1882–1903  ·  view source on GitHub ↗
(input: &str, output: &mut Vec<u8>)

Source from the content-addressed store, hash-verified

1880}
1881
1882fn base64_decode(input: &str, output: &mut Vec<u8>) {
1883 let mut buf = 0u32;
1884 let mut bits = 0u32;
1885 for &b in input.as_bytes() {
1886 let val = match b {
1887 b'A'..=b'Z' => b - b'A',
1888 b'a'..=b'z' => b - b'a' + 26,
1889 b'0'..=b'9' => b - b'0' + 52,
1890 b'+' => 62,
1891 b'/' => 63,
1892 b'=' | b'\n' | b'\r' => continue,
1893 _ => continue,
1894 };
1895 buf = (buf << 6) | val as u32;
1896 bits += 6;
1897 if bits >= 8 {
1898 bits -= 8;
1899 output.push((buf >> bits) as u8);
1900 buf &= (1 << bits) - 1;
1901 }
1902 }
1903}
1904
1905// ---- Catmull-Rom spline helpers (Q9) ----
1906

Callers 4

load_gltf_animationFunction · 0.85
load_gltf_with_texturesFunction · 0.85
load_gltf_stagedFunction · 0.85
load_gltfFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected