Best way to generate sequential ids

I saw something like ksuid before, the problem is that we need the ids to be inside a particular range, so yeah an increasing counter. For example:

For product A we have the range 202043200000000 to 202043210000000, so the generated numbers would be:

  • 202043200000000
  • 202043200000001
  • 202043200000002

For product B we could have a range of 13200500 to 20500000 so

  • 13200500
  • 13200501
  • 13200502