Skip to content

Commit

Permalink
speedup (#98)
Browse files Browse the repository at this point in the history
* Speedup

* fix
  • Loading branch information
adriandavila authored Dec 28, 2023
1 parent ee1b6ea commit 10b57e7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions extras/ortoa/data_generation/generators/value_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ def __init__(self, num_bytes: int):
def generate_value(self):
generated = str(self.num_bytes)

generated = generated + "".join(
[
chr(random.randint(0, 25) + ord("a"))
for _ in range(self.num_bytes - len(generated))
]
)
remaining = self.num_bytes - len(generated)
while remaining > 0:
random_char = chr(random.randint(0, 25) + ord("a"))
generated += random_char * min(25, remaining)
remaining -= 10

return generated


Expand Down

0 comments on commit 10b57e7

Please sign in to comment.