Expand description
Rust fast &[u8]
to integer parser (x86_64 SIMD, SSE4.1, AVX2)
If you have &str
then use .as_bytes()
Supported output types: u8, i8, u16, i16, u32, i32, u64, i64, u128, i128, usize, isize. The 128 bit max slice length is 32 numbers (33 with ‘-’ sign), because it’s limited by AVX2.
Has good test coverage, and can be considered safe.
Examples
let val: u64 = atoi_simd::parse("1234".as_bytes()).unwrap();
assert_eq!(val, 1234_u64);
assert_eq!(atoi_simd::parse::<i64>("-2345".as_bytes()).unwrap(), -2345_i64);
Enums
Not for public use.