#security #web-apps #base64 #codec #applications #predictable

caido-convert

Encoding library for web security applications

13 stable releases

1.2.1 Jul 7, 2023
1.1.5 Apr 4, 2023
1.1.4 Feb 27, 2023
0.1.0 Jan 27, 2023

#1725 in Encoding

MIT license

23KB
625 lines

👋 Convert

Welcome to caido convert package! This repo contains the code we use to encode, hash, zip and much more. This library focus on providing a decent API for diverse encoding need in a web application context. It is Grapheme aware when needed and tries to provide predictable encoding/decoding behavior.

Examples

Base64

fn main() {
  use caido_convert::{Base64Decode, Operation, Base64Encode};

  let encoder = Base64Decode::new();
  let decoded = encoder.execute("Y2FpZG8=".as_bytes()).unwrap();
  println!("{}", String::from_utf8(decoded).unwrap()); // caido

  let encoder = Base64Encode::new();
  let encoded = encoder.execute("caido".as_bytes()).unwrap();
  println!("{}", String::from_utf8(encoded).unwrap()); // Y2FpZG8=
}

Dependencies

~1.4–2.2MB
~44K SLoC