zoukankan      html  css  js  c++  java
  • BREW 实现字符串MD5编码

    BREW 普通MD5字符串编码实现,使用BREW的IHASH API.

    输入要编码的字符串,可在输出窗口看到编码后的32位字符串。

    void verify_md5(byte *input){     IHash* po = NULL;     byte pResult[16];     int i = 0, ret = 0;     int len = 16;     char   tmpstr[33],   *p   =   tmpstr;  

        if (AEE_SUCCESS == ISHELL_CreateInstance(APP_SHELL, AEECLSID_MD5, (void**)&po)){         DBGPRINTF("---------md5 hase create instance OK-------------");         IHASH_Update(po,  (byte*)input, STRLEN(input));         ret = IHASH_GetResult(po,  pResult, &len);         if(SUCCESS == ret){               for(i=0;   i<16;   i++){                    p+=   sprintf(p,   "%02x",   pResult[i]);                 }               tmpstr[32] = '/0';               DBGPRINTF("before md5 str is: %s", (char *)input);               DBGPRINTF("md5 str: %s", (char *)tmpstr);         }else if(AEE_HASH_MORE_DATA == ret){              DBGPRINTF("---------Buffer not large enough to hold hashed result. -------------");         }         else{             DBGPRINTF("---------get result error-------------");         }         IHASH_Release(po);

        }else{         DBGPRINTF("---------md5 hase create instance error-------------");     } }

  • 相关阅读:
    Java代码是怎么运行的
    Java单例模式
    redis分布式锁实现
    zuul2.0
    配置ssh免密钥登陆多台从机
    Nifi-install-config
    Configure Access to Multiple Clusters
    kubernetes集群搭建(kubeadm,kubelet)
    shell 编程
    系统管理
  • 原文地址:https://www.cnblogs.com/secbook/p/2655470.html
Copyright © 2011-2022 走看看