This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: do not stringify output of object data
Without this change: ```sh $ jsipfs object data `dd if=/dev/urandom bs=307200 count=1 | jsipfs files write --create /some-file && jsipfs files ls -h /some-file` | unixfs {"type":"file","blockSizes":[72481833443311,10909182287855]} ``` e.g. ``` 00000000: 0802 18ef bfbd efbf bd12 20ef bfbd efbf .......... ..... 00000010: bd10 20ef bfbd efbf bd02 .. ....... ``` With this change: ```sh $ jsipfs object data `dd if=/dev/urandom bs=307200 count=1 | jsipfs files write --create /some-file && jsipfs files ls -h /some-file` | unixfs {"type":"file","blockSizes":[262144,45056]} ``` e.g. ``` 00000000: 0802 1880 e012 2080 8010 2080 e002 ...... ... ... ``` Stringifying the data changes it's encoding. Been banging my head against this all morning.
- Loading branch information
1 parent
cd449ff
commit d1ea007
Showing
3 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ module.exports = { | |
throw err | ||
} | ||
|
||
print(data.toString(), false) | ||
print(data, false) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters