开发者

php email confirm code algo?

开发者 https://www.devze.com 2022-12-19 07:10 出处:网络
I saw a \'confirm_code\' column in a db table, and property of the column is varchar(100), can you guys give me idea of a nice algo for a confirmation code ? Basically, it should consist of a random c

I saw a 'confirm_code' column in a db table, and property of the column is varchar(100), can you guys give me idea of a nice algo for a confirmation code ? Basically, it should consist of a random characters. The simplest things in my mind is just encrypting a string through md5 or sha1 but it won't f开发者_开发技巧it because of the current column property.


An md5 hash should easily fit in a varchar(100)... in hex form an MD5 hash is typically 32 characters long.


You can generate unique ID's with uniqid().

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号