3 unstable releases
0.2.0 | Dec 4, 2021 |
---|---|
0.1.1 | Nov 27, 2021 |
0.1.0 | Nov 27, 2021 |
#2493 in Encoding
28KB
589 lines
arrowvortex_clipboard
Small library for encoding and decoding ArrowVortex clipboard data. For more information, see the docs.
lib.rs
:
Small library for encoding and decoding ArrowVortex clipboard data. Ported from av-clipboard-lib, a Python libary by DeltaEpsilon.
Main credit goes to DeltaEpsilon for reverse-engineering ArrowVortex' clipboard functions and implementing the first ArrowVortex clipboard library.
// EtternaOnline noteskin template pattern (https://etternaonline.com/noteskins)
let data = r#"ArrowVortex:notes:!"8i-K)chjJHuM^!#P_Z![IjrJi#:bJ2UO3!BC3L"%E"#;
// Decode string into Vec<Note>
let notes = match arrowvortex_clipboard::decode(data.as_bytes())? {
arrowvortex_clipboard::DecodeResult::RowBasedNotes(notes) => notes,
_ => panic!("Unexpected data type"),
};
println!("{:?}", notes);
// Encode &[Note] into string
let buffer = arrowvortex_clipboard::encode_row_based_notes(¬es)?;
println!("{}", buffer);
// Verify that string stayed identical after roundtrip
assert_eq!(data, buffer);