optimized fromBits