如何从codeigniter中的spl_object_hash()函数生成唯一ID?

如何从codeigniter中的spl_object_hash()函数生成唯一ID?,codeigniter,Codeigniter,我有一个客户表,我需要手动为每个客户生成唯一的id,而不是在mysql中自动递增。如何做到这一点?有人建议我使用uniqid(md5(spl_object_hash($custApp)),false)编写下面的代码功能: $data = file_get_contents("php://input"); $custApp = json_decode(base64_decode($data)); $custApp->Id = uniqid(md5(spl_object_hash($cus

我有一个客户表,我需要手动为每个客户生成唯一的id,而不是在mysql中自动递增。如何做到这一点?有人建议我使用
uniqid(md5(spl_object_hash($custApp)),false)编写下面的代码功能:

$data = file_get_contents("php://input");

$custApp = json_decode(base64_decode($data));

$custApp->Id = uniqid(md5(spl_object_hash($custApp)), false);

但是我不知道如何在我的代码中使用这个函数

使用
sha1($nombre_-customer)
并保存您的id如何唯一(

time()
是最佳唯一值$nombre_-customer变量是什么?