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

Integers in DAGs are serialized as doubles (in CLI) #4635

Closed
lbelyaev opened this issue Jan 31, 2018 · 2 comments
Closed

Integers in DAGs are serialized as doubles (in CLI) #4635

lbelyaev opened this issue Jan 31, 2018 · 2 comments

Comments

@lbelyaev
Copy link

Version information:

go-ipfs version: 0.4.13-
Repo version: 6
System version: amd64/linux
Golang version: go1.9.2

Type:

Bug?

Severity:

Medium

Description:

Hi,
Looks like ipfs CLI (ipfs dag put ) serializes integers in DAGs as double-precision floats, is this a bug or intentional decision?

example:
echo '{"var":1}' | ipfs dag put
zdpuAxQm7QaVc9ufEyKcqNX35WLw7LwdtYkhD4ksvuvaeeaBW

test:
ipfs block get zdpuAxQm7QaVc9ufEyKcqNX35WLw7LwdtYkhD4ksvuvaeeaBW | xxd
00000000: a163 7661 72fb 3ff0 0000 0000 0000 .cvar.?.......

Thanks
Leo

@Stebalien
Copy link
Member

See: ipld/interface-ipld-format#9. There are a lot of decisions we need to make concerning primitive types in IPLD.

@lbelyaev
Copy link
Author

lbelyaev commented Feb 1, 2018

@Stebalien thanks for the reference, I probably missed the earlier thread. Looking at ipld/interface-ipld-format#9 , i tend to agree with @kevina 's proposal, but I might not be aware of all the moving parts

@lbelyaev lbelyaev closed this as completed Feb 1, 2018
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

No branches or pull requests

2 participants