Skip to content

Commit

Permalink
Fully replace usage of base64 crate
Browse files Browse the repository at this point in the history
  • Loading branch information
kpcyrd committed Jan 7, 2024
1 parent fca342e commit 003158f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]

Expand Down
14 changes: 8 additions & 6 deletions examples/read_packet.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
extern crate base64;
extern crate sniffglue;
extern crate env_logger;

use data_encoding::BASE64;
use sniffglue::errors::*;
use std::env;

fn main() {
fn main() -> Result<()> {
env_logger::init();

for arg in env::args().skip(1) {
let bytes = base64::decode(&arg).unwrap();
let bytes = BASE64
.decode(arg.as_bytes())
.context("Failed to base64 decode")?;
println!("{:?}", bytes);

let packet = sniffglue::centrifuge::parse_eth(&bytes);
println!("{:?}", packet);
}

Ok(())
}

0 comments on commit 003158f

Please sign in to comment.