squidgetx / arklet

ARK minter, binder, resolver with custom detailing for the Frick Art Museum
MIT License
2 stars 6 forks source link

noid generation is kinda dumb #17

Open squidgetx opened 1 year ago

squidgetx commented 1 year ago

Current implementation is basically this:

BETANUMERIC = "0123456789bcdfghjkmnpqrstvwxz"
def generate_noid(length: int) -> str:
    return "".join(secrets.choice(BETANUMERIC) for _ in range(length))

and when an ARK is minted we call generate_noid(8) and then just try again if there is a collision

There's no way this is actually good lol, i mean it's not actually the worst but performance would definitely be better if we used numbers or uuids.

https://metacpan.org/dist/Noid/view/noid

37B combinations