vinkla / hashids

A small PHP library to generate YouTube-like ids from numbers. Use it when you don't want to expose your database ids to the user.
https://hashids.org/php
MIT License
5.28k stars 418 forks source link

Generate integers no strings #142

Closed FuriosoJack closed 4 years ago

FuriosoJack commented 4 years ago

please, Generate integers no strings

roukmoute commented 4 years ago

It is not the goal of hashids, read its website: https://hashids.org/ But if you really need it (don't recommended, too big number, risky of duplicates), you can use an alphabet and insert only numbers, next just cast into an integer.

FuriosoJack commented 4 years ago

It is not the goal of hashids, read its website: https://hashids.org/ But if you really need it (don't recommended, too big number, risky of duplicates), you can use an alphabet and insert only numbers, next just cast into an integer.

thanks, although what I needed was also to generate from a string a random string of single numbers (not necessarily an integer) and this package only generates string or from two integers (array (41,1)), but if you know any package do that thanks @roukmoute