How to generate unique number of 12 digits?

前端 未结 4 1504
误落风尘
误落风尘 2021-01-03 17:08

I\'m working on an app that sends raw data to zebra printer and print out barcodes. And since every item has its own unique barcode, I need to define a variable that automat

4条回答
  •  我在风中等你
    2021-01-03 17:38

    Start with a twelve digit number, ie: 111111111111

    to get your new 'random' unique number take the previous number and add 1.

    although not random, it will guarantee uniqueness.

提交回复
热议问题