SAP 字符串加密 - MD5

针对字符串进行MD5加密,可以采用这个函数:CALCULATE_HASH_FOR_CHAR

具体代码样例:

DATA: lv_string     TYPE string,
      lv_hashstring TYPE string.

lv_string = 'test'.

CALL FUNCTION 'CALCULATE_HASH_FOR_CHAR'
    EXPORTING
      alg            = 'MD5'
      data           = lv_string
    IMPORTING
      hashstring     = lv_hashstring
    EXCEPTIONS
      unknown_alg    = 1
      param_error    = 2
      internal_error = 3
      OTHERS         = 4.

WRITE: / lv_hashstring.

你可能感兴趣的:(哈希算法,安全,算法,abap,sap)