Skip to content

Instantly share code, notes, and snippets.

@indy-singh
Created June 17, 2023 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indy-singh/3eebda9113d844c2559eafbdaa7d4f8b to your computer and use it in GitHub Desktop.
Save indy-singh/3eebda9113d844c2559eafbdaa7d4f8b to your computer and use it in GitHub Desktop.
from itertools import count
from tqdm import tqdm
import mmh3
from uuid import uuid4
try:
for _ in tqdm(count()):
val = str(uuid4())
h = mmh3.hash(val)
if h == 1228476406:
print()
print(val)
print()
except KeyboardInterrupt:
pass
@indy-singh
Copy link
Author

import time
import mmh3
from uuid import uuid4

start = time.perf_counter()
inc = 0

while True:
   val = str(uuid4())
   h = mmh3.hash(val)
   if h == 1228476406:
      print(val)
   stop = time.perf_counter()
   duration = stop - start
   inc = inc + 1
   if duration >= 10:
      print(inc)
      break

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment