#![feature(const_trait_impl)] use cryptix_bigint::{BigUInt, bigint, property::IsBigInt}; type U256 = BigUInt; const ZERO: U256 = U256::ZERO; const RAND: U256 = BigUInt([0xa6ccf2f03cec75ff_u64, 0xe5f5859642966640, 0x97b19925fa2eba34, 0x1678591cc3f3fc22]); #[test] fn test_from_to_str() { let mut a: U256 = bigint!(U256, "00"); assert_eq!(a, ZERO); let rand_str = "1678591cc3f3fc2297b19925fa2eba34e5f5859642966640a6ccf2f03cec75ff"; a = bigint!(U256, "1678591cc3f3fc2297b19925fa2eba34e5f5859642966640a6ccf2f03cec75ff"); assert_eq!(a, RAND); assert_eq!(format!("{RAND}"), rand_str); }