Comments (5)
I don't fallow your logic on what are you trying to convert and whats wrong.
SerializationHelper.DecimalToBinary is the same implementation from eosjs2 and converts a string to a byte[] representation in a given size.
Can you give more details on what you are trying to test? Function call?
string doubleStr = "10001";
var doubleBytes = SerializationHelper.DecimalToBinary(8, doubleStr);
returns: 17 39 0 0 0 0 0 0
var doubleBytes2 = BitConverter.GetBytes(Convert.ToUInt64(doubleStr));
returns: 17 39 0 0 0 0 0 0
same for the 16 bytes version...
Even thought I find your pull request a more cleaner solution is not as generic as the eosjs2 version. Not that we need anything othern than 4, 8, 16 bytes storage size.
from eos-sharp.
Strange - I wonder then why my result is
string doubleStr = "10001";
var doubleBytes = SerializationHelper.DecimalToBinary(8, doubleStr);
returns: 17 0 0 0 0 0 0 0
from eos-sharp.
Can you execute this on your target machine?
bool le = BitConverter.IsLittleEndian;
What is the result?
What is your OS and hardware specifications?
from eos-sharp.
The result is true.
Windows 10 Professional, 64 bit
from eos-sharp.
I'm using same OS and the same littleendianess this may be hardware related or you are using other version of the netstandard. Other than that I can't reproduce this behavior.
Created some unit tests for this you may try the different approaches.
Going to close this issue but feel free to repopen if you got more detail.
from eos-sharp.
Related Issues (20)
- a GetBlock bug HOT 1
- AesEncrypt throws CryptographicException: 'Specified initialization vector (IV) does not match the block size for this algorithm.' HOT 1
- Implement TAPoS ref block with blocks behind
- How to generate the public key from a private key in eos-Sharp? HOT 1
- object to float conversion InvalidCastException HOT 2
- eos-sharp api call gets failed HOT 1
- Broadcast fails when data contains Digital Signature HOT 2
- How to use eos-sharp with ASP .NET core web API
- How to access multiindex table by its primary key?
- How to call action from eos-sharp? HOT 1
- Use TLS 1.2 in ASP.NET Core 3.1 HOT 1
- Generate uuid or unique ID in smart contract. HOT 1
- AbiSerialization error
- get Actions Count HOT 1
- Get table rows limit
- eos-sharp is not actively maintained discussion HOT 7
- Incorrect SIGN_KEY_DATA_SIZE
- When calling CreateTransaction - the response ended prematurely - Calling Wax chain
- incorrect ReadAction in AbiSerializationProvider
- Error when pushing transaction
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eos-sharp.