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-------------");     } }

  • 相关阅读:
    C++实现多项式曲线拟合--polyfit-超定方程
    C# XmlDocument操作XML
    C#下使用XmlDocument详解
    前端常见的9种设计模式
    前端常用的设计模式
    前端需要了解的9种设计模式
    TCP协议详解
    请UI小姐姐喝了一杯奶茶要来的网站
    nodemon 基本配置与使用
    wireshark抓包新手使用教程
  • 原文地址:https://www.cnblogs.com/secbook/p/2655470.html
Copyright © 2011-2022 走看看