Skip to content

fix: trim trailing null in MQL to_hex - #29

Merged
LimiNode merged 1 commit into
mainfrom
codex/fix-to_hex-function-for-string-processing
Sep 3, 2025
Merged

fix: trim trailing null in MQL to_hex#29
LimiNode merged 1 commit into
mainfrom
codex/fix-to_hex-function-for-string-processing

Conversation

@LimiNode

@LimiNode LimiNode commented Sep 3, 2025

Copy link
Copy Markdown
Owner

Summary

  • handle null terminator when converting MQL strings to hex

Testing

  • GTEST_FILTER='-HashTest.SHA512LargeInput' ./build/test_all
  • `python - <<'PY'
    from binascii import hexlify

def to_hex_fixed(s, is_upper=False):
arr = s.encode('utf-8') + b'\x00'
if arr and arr[-1] == 0:
arr = arr[:-1]
hex_str = hexlify(arr).decode()
return hex_str.upper() if is_upper else hex_str

print(to_hex_fixed('A'))
PY`


https://chatgpt.com/codex/tasks/task_e_68b8ca71ab00832ca5bdec7bd241c8b9

Remove null terminator inserted by StringToCharArray to avoid stray 00 in hex output.
@LimiNode
LimiNode merged commit 3a853a4 into main Sep 3, 2025
4 checks passed
@LimiNode
LimiNode deleted the codex/fix-to_hex-function-for-string-processing branch September 4, 2025 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant