-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add Itoa atoi syscalls #2043
Add Itoa atoi syscalls #2043
Conversation
@@ -23,6 +27,21 @@ protected internal StackItem BinaryDeserialize(byte[] data) | |||
return BinarySerializer.Deserialize(data, Limits.MaxStackSize, Limits.MaxItemSize, ReferenceCounter); | |||
} | |||
|
|||
protected internal string Itoa(BigInteger value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think base
parameter would be nice to have here (and for Atoi
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look, octal and binary was not added, do you think that it's needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be fair I'd expect some regular 2-36 range to be supported here (like it's not a problem for big.Int in Go), but from a quick glance it looks like .NET's BigInteger doesn't make it easy even for 2-16 range (like in this SO q/a). So maybe we can try to go with only 10 and 16 supported for now, it's not that hard to extend it in the future if need be.
Co-authored-by: Erik Zhang <[email protected]>
Co-authored-by: Erik Zhang <[email protected]>
Co-authored-by: Erik Zhang <[email protected]>
Co-authored-by: Erik Zhang <[email protected]>
* Itoa atoi * add base * Update src/neo/SmartContract/ApplicationEngine.Binary.cs Co-authored-by: Erik Zhang <[email protected]> * Update src/neo/SmartContract/ApplicationEngine.Binary.cs Co-authored-by: Erik Zhang <[email protected]> * Fix ut * Clean code * Update src/neo/SmartContract/ApplicationEngine.Binary.cs Co-authored-by: Erik Zhang <[email protected]> * Update src/neo/SmartContract/ApplicationEngine.Binary.cs Co-authored-by: Erik Zhang <[email protected]> * Fix ut Co-authored-by: Erik Zhang <[email protected]>
* Itoa atoi * add base * Update src/neo/SmartContract/ApplicationEngine.Binary.cs Co-authored-by: Erik Zhang <[email protected]> * Update src/neo/SmartContract/ApplicationEngine.Binary.cs Co-authored-by: Erik Zhang <[email protected]> * Fix ut * Clean code * Update src/neo/SmartContract/ApplicationEngine.Binary.cs Co-authored-by: Erik Zhang <[email protected]> * Update src/neo/SmartContract/ApplicationEngine.Binary.cs Co-authored-by: Erik Zhang <[email protected]> * Fix ut Co-authored-by: Erik Zhang <[email protected]>
Required for neo-project/neo-devpack-dotnet#385