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

前端 未结 7 1350
暖寄归人
暖寄归人 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:29

    You could do a CRC calculation.

    Basically, just start to add each character in the string, and limit the length to a long integer.

    You may start with a known random number and store it in the first 4 bytes, and have the last four be a calculation as I described earlier.

    This would be two ints, or eight bytes.

提交回复
热议问题