2020 Aug 28 1:51 PM
Hey SAPlers!
I recently tried to use the function module 'MD5_CALCULATE_HASH_FOR_CHAR' for cyrillic characters, but unfortunately noticed that different strings produce the same hash. Is this because the codepage is different? If so, how can I still use cyrillic characters?
See the sample code below.
REPORT Z_TEST_HASH.
DATA: string1 TYPE string VALUE 'CUS&ДЕКЛT9',
string2 TYPE string VALUE 'CUS&КОРРT9',
hash1(32) TYPE c,
hash2(32) TYPE c.
CALL FUNCTION 'MD5_CALCULATE_HASH_FOR_CHAR'
EXPORTING
data = string1
IMPORTING
hash = hash1
EXCEPTIONS
no_data = 1
internal_error = 2
OTHERS = 3.
CALL FUNCTION 'MD5_CALCULATE_HASH_FOR_CHAR'
EXPORTING
data = string2
IMPORTING
hash = hash2
EXCEPTIONS
no_data = 1
internal_error = 2
OTHERS = 3.
BREAK-POINT.
Hey SAPlers!
I recently tried to use the function module 'MD5_CALCULATE_HASH_FOR_CHAR' for cyrillic characters, but unfortunately noticed that different strings produce the same hash. Is this because the codepage is different? If so, how can I still use cyrillic characters?
See the sample code below.
REPORT Z_TEST_HASH.
DATA: string1 TYPE string VALUE 'CUS&ДЕКЛT9',
string2 TYPE string VALUE 'CUS&КОРРT9',
hash1(32) TYPE c,
hash2(32) TYPE c.
CALL FUNCTION 'MD5_CALCULATE_HASH_FOR_CHAR'
EXPORTING
data = string1
IMPORTING
hash = hash1
EXCEPTIONS
no_data = 1
internal_error = 2
OTHERS = 3.
CALL FUNCTION 'MD5_CALCULATE_HASH_FOR_CHAR'
EXPORTING
data = string2
IMPORTING
hash = hash2
EXCEPTIONS
no_data = 1
internal_error = 2
OTHERS = 3.
BREAK-POINT.
2020 Aug 28 2:05 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |