Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the bug in the h-string literal calculation. #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

a2468834
Copy link

The original calculation results in 64-bit hexadecimal string which is not consistent with the description in TON document.

h—creates an int constant that is the first 32 bits of the SHA256 hash of the string.
https://docs.ton.org/develop/func/literals_identifiers

Copy link

@alijawan alijawan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F9wskA3LLq9BBeVtnYPB

@a2468834
Copy link
Author

@alijawan Please do not leave irrelevant comments.

@a2468834
Copy link
Author

@dvlkv Hello 👋
I have found a bug related to prompt hexadecimal of h-string literals

In the TON document, ""h is defined as the first 32 bits of the SHA256 hash of the string literal. And I have verified this feature through compiling contract with v0.4.4 FunC compiler.

I believe this bug fix could be quite useful for the developers.

Copy link
Member

@awesome-doge awesome-doge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all gooood

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants