Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created May 22, 2018 08:53
Show Gist options
  • Save rust-play/6e859f32d1ba894d346042524e381296 to your computer and use it in GitHub Desktop.
Save rust-play/6e859f32d1ba894d346042524e381296 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
extern crate num;
use num::bigint::BigInt;
fn main() {
match "123123123123123123123".parse::<BigInt>() {
Ok(n) => println!("{}", n),
Err(_) => println!("Error")
}
let bytes = "ff".as_bytes();
let i = BigInt::parse_bytes(bytes, 16).unwrap();
println!("{}", i);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment