MCPcopy Create free account
hub / github.com/Logicalshift/flo_draw / encode_compact_u64

Function encode_compact_u64

canvas/src/encoding.rs:29–47  ·  view source on GitHub ↗
(val: &u64, append_to: &mut String)

Source from the content-addressed store, hash-verified

27///
28#[inline]
29fn encode_compact_u64(val: &u64, append_to: &mut String) {
30 let mut val = *val;
31
32 for _ in 0..13 {
33 let five_bits = (val & 0x1f) as usize;
34 let remaining = val >> 5;
35
36 if remaining != 0 {
37 let next_char = ENCODING_CHAR_SET[five_bits | 0x20];
38 append_to.push(next_char);
39 } else {
40 let next_char = ENCODING_CHAR_SET[five_bits];
41 append_to.push(next_char);
42 break;
43 }
44
45 val = remaining;
46 }
47}
48
49impl CanvasEncoding<String> for char {
50 #[inline]

Callers 1

encode_canvasMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected