This avoids an allocation and, more importantly, turns `digits` into a fixed size array, allowing the final calculations to be unrolled completely.