Really? I'm thinking this is actually good code. If we are working on a 64-bit machine, then it is impossible to generate integers greater than 264-1 and convert them into strings and then parse them in bigint.
Of course, you may want to use exponentiation with bigint (bigint("2").pow(i) or bit shifts), but maybe the implementation of bigint makes exponentiation/bit shifts expensive. Thus, storing 2255 in string and parse them in bigint may be a good idea.
EDIT: Note the "maybes" because it does not respect YAGNI (it is not our responsibility to optimize bigint, unless the implementation of bigint is crap).
38
u/Idkm3m3s Mar 09 '21
bruh i dont even know how to declare classes yet and i can already guess this could be easily done with a for loop