douzhang5984 2012-03-25 12:56
浏览 6
已采纳

too long

I am planning to build, for lack of a better term, a multi user Customer Relationship Manager (CRM) and I want to create a unique identifier that is easy to transmit in email, via text, and verbally to other team members.

For Example:

I upload my list of 100 customers and John Smith and his phone number are included in that list. Upon upload, I want to generate a hidden fingerprint / unique identifier for John Smith in the database, and then propagate a 12 digit number that can be shared publicly.

In my mind like this - john smith + ph: 5557898095 = fingerprint: 7e013d7962800374e6e67dd502f2d7c0 displays to end user id number: 103457843983

My question is - what method or process should I use to take the name and phone number, generate a hidden key, and then translate to a displayable key that is linked to the hidden one?

I hope this clear. I mainly want to use the right logic process.

  • 写回答

3条回答 默认 最新

  • dssqq82402 2012-03-25 13:08
    关注

    I don't understand what your problem really is, but i'll try.

    It seems like you mean something like this:

    A sql table which saves the public and private id (and maybe other things).

    You can generate a key like this:

    $chars = '0123456789abcedfghijklmnopqrstuvwxyz';
    
    function generateKey($length, $charsLength = 10) {
        global $chars;
    
        $key = '';
    
        for($i=0;$i<$length;++$i) {
            $key .= $chars[rand(0, $charsLength - 1)];
        }
    
        return $key;
    }
    
    $keyPublic = generateKey(10); // Public key with length 10
    
    // Now check if the key already exist
    while(mysql_num_rows(mysql_select('SELECT publicKey FROM keys WHERE publicKey = \''.$keyPublic.'\')) === 1) {
        $keyPublic = generateKey(10);
    }
    
    $keyPrivate = generateKey(10, 36); // Private key with length 10
    
    // Now check if the key already exist
    while(mysql_num_rows(mysql_select('SELECT privateKey FROM keys WHERE privateKey = \''.$keyPrivate.'\')) === 1) {
        $keyPrivate = generateKey(10, 36);
    }
    

    In this example there are two keys generated and it is checked if the keys already exist. (in the example in the table "keys").

    (Sorry for my bad english).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退
  • ¥20 win系统的PYQT程序生成的数据如何放入云服务器阿里云window版?
  • ¥50 invest生境质量模块
  • ¥15 nhanes加权logistic回归,svyglm函数