# Random room number

**URL:** <https://forum.heroiclabs.com/t/random-room-number/851>\
**Category:** Game Design\
**Created:** [July 10, 2020, 1:54pm UTC](https://forum.heroiclabs.com/t/random-room-number/851 "2020-07-10T13:54:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohammed](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@Mohammed](https://forum.heroiclabs.com/u/Mohammed)\
**Post date:** [July 10, 2020, 1:54pm UTC](https://forum.heroiclabs.com/t/random-room-number/851/1 "2020-07-10T13:54:58Z")

</div>

Any suggestion on how to generate random room number (digits) only  
like 82649826 from 6 to 8 digits  
the room number must be unique

I need this to invite others to a match

---

<div class="post-metadata">

**Author:** ![novabyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/novabyte/32/1324_2.png) [@novabyte](https://forum.heroiclabs.com/u/novabyte)\
**Post date:** [July 21, 2020, 10:54pm UTC](https://forum.heroiclabs.com/t/random-room-number/851/2 "2020-07-21T22:54:42Z")

</div>

@Mohammed We usually recommend a library like Hashids: [https://hashids.org/](https://hashids.org/) but it doesn’t fit the requirements you have that the room number to use for invites is numeric only.
