Ideas to create a small (<10 digits), not (very) secure “hash”

前端 未结 7 1356
暖寄归人
暖寄归人 2020-12-13 02:48

I\'m working on an online event ticketing system, where users will be able to self print his tickets and show up at the event where it will be scanned (barcode) and ideally

7条回答
  •  青春惊慌失措
    2020-12-13 03:21

    For offline verification, I see only one easy solution..

    Append to the ticket ID a hash of the ticket ID and a per-event salt. You can truncate any cryptographic hash to the size desired. I can't think of a particular reason to use anything but a random number for the base ticket ID itself.

    This allows you to limit the size of the ticket ID and have a clearly proportional security in relation to the size of the ticket ID.

提交回复
热议问题