Skip to content

Add Itoa atoi syscalls#2043

Merged
shargon merged 12 commits intoneo-project:masterfrom
shargon:itoa-atoi
Nov 8, 2020
Merged

Add Itoa atoi syscalls#2043
shargon merged 12 commits intoneo-project:masterfrom
shargon:itoa-atoi

Conversation

@shargon
Copy link
Member

@shargon shargon commented Nov 3, 2020

return BinarySerializer.Deserialize(data, Limits.MaxStackSize, Limits.MaxItemSize, ReferenceCounter);
}

protected internal string Itoa(BigInteger value)
Copy link
Contributor

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).

Copy link
Member Author

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?

Copy link
Contributor

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.

@shargon shargon merged commit 788b2b2 into neo-project:master Nov 8, 2020
@shargon shargon deleted the itoa-atoi branch November 8, 2020 09:23
@erikzhang erikzhang added this to the NEO 3.0 milestone Nov 9, 2020
ShawnYun pushed a commit to ShawnYun/neo that referenced this pull request Jan 8, 2021
* Itoa atoi

* add base

* Update src/neo/SmartContract/ApplicationEngine.Binary.cs

Co-authored-by: Erik Zhang <erik@neo.org>

* Update src/neo/SmartContract/ApplicationEngine.Binary.cs

Co-authored-by: Erik Zhang <erik@neo.org>

* Fix ut

* Clean code

* Update src/neo/SmartContract/ApplicationEngine.Binary.cs

Co-authored-by: Erik Zhang <erik@neo.org>

* Update src/neo/SmartContract/ApplicationEngine.Binary.cs

Co-authored-by: Erik Zhang <erik@neo.org>

* Fix ut

Co-authored-by: Erik Zhang <erik@neo.org>
cloud8little pushed a commit to cloud8little/neo that referenced this pull request Jan 24, 2021
* Itoa atoi

* add base

* Update src/neo/SmartContract/ApplicationEngine.Binary.cs

Co-authored-by: Erik Zhang <erik@neo.org>

* Update src/neo/SmartContract/ApplicationEngine.Binary.cs

Co-authored-by: Erik Zhang <erik@neo.org>

* Fix ut

* Clean code

* Update src/neo/SmartContract/ApplicationEngine.Binary.cs

Co-authored-by: Erik Zhang <erik@neo.org>

* Update src/neo/SmartContract/ApplicationEngine.Binary.cs

Co-authored-by: Erik Zhang <erik@neo.org>

* Fix ut

Co-authored-by: Erik Zhang <erik@neo.org>
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