It’s quite simple: I want to retrieveFile(fileHash)
where fileHash
is the output of md5sum $file
or sha256sum $file
, or whatever other hashing algorithm exists.
- 2 Posts
- 11 Comments
I’m not sure what your concern is. I’d basically like to call a function
retrieveFile(fileHash)
and get bytes back. Or callretrieveFileLocations(fileHash)
and get URIs back to where the file can be downloaded. Also, it’ll be opensource, so nothing to reverse engineer.
How do I retrieve a file from bittorrent with just its hash? Does WebMirror solve that? I’ll have a look at it…
If you
sha256sum $file
and send that hash to somebody, they can’t download the file from IPFS (unless it’s <2MB IINM), that’s the problem. And it can be any hashing algorithm md5, blake, whatever.
tinkralge@programming.devOPto Linux@programming.dev•PSA: /c/linux has a matrix chat!English4·10 months agoSure, why not. I’m not the creator of the room 🙂
tinkralge@programming.devOPto Linux@programming.dev•PSA: /c/linux has a matrix chat!English2·10 months agoI know that @Ategon@programming.dev is there. Maybe he can make you a mod there too? And the channel could be added to the sidebar of this community too.
tinkralge@programming.devto Rust@programming.dev•What are you working on this week? (Mar. 31, 2024)English3·1 year agoThis week some more work was done on inheriteRS to support inheriting non-trait implementations of functions.
Basically
use inheriters::specialisations; specialisations!( struct Parent { attr1: u8, } impl Parent { fn from_parent(self) -> u8 { 8 } fn overridden(self) -> u8 { self.attr1 } } #[inherit(Child)] struct Child { attr2: u8, } impl Child { fn overridden(self) -> u8 { self.attr2 } } );
results in
struct Parent { attr1: u8, } impl Parent { fn from_parent(self) -> u8 { 8 } fn overridden(self) -> u8 { self.attr1 } } struct Child { attr1: u8, // new attr2: u8, } impl Child { fn from_parent(self) -> u8 { 8 } // new fn overridden(self) -> u8 { self.attr2 } }
There might be some clean-up necessary code-wise and the README has to be expanded. But the project is well on its way to version 1! It’s a pity codeberg doesn’t have easy CI/CD yet nor domain hosting e.g inheriters.codeberg.io or something. So auto-formatting, testing, auto-tagging, etc. will have to come once I can convince myself to setup a VPS somewhere that hosts all that.
tinkralge@programming.devto Rust@programming.dev•What are you working on this week? (Mar. 24, 2024)English2·1 year agoThat sounds like fun! Wow. How stable is it at the moment?
tinkralge@programming.devto Rust@programming.dev•What are you working on this week? (Mar. 24, 2024)English41·1 year agoWorking on some form of inheritance in rust. It’s my first foray into procedural macros and so far it’s fun. The idea is quite simple: generate structs with common attributes (and eventually functions) instead writing them yourself.
use inheriters::specialisations; specialisations!( struct Parent { attr1: u8, } #[inherit(Child)] struct Child { attr2: u8, } );
becomes
struct Parent { attr1: u8, } struct Child { attr1: u8, attr2: u8, }
not
struct Parent { attr1: u8, } struct Child { attr1: u8, parent: Parent, }
The latter leads to indirection which I’m not a fan of.
Last week I squashed one bug on the order of attributes according to inheritance. In the example above
attr2
was coming beforeattr1
. A feature is nearly done to exclude theParent
from the output and only output the child. That’s useful for parents that just serve as holders for shared attributes.The goal for v1 was to also support basic inheritance of implementations:
Parent
has animpl
block, then that block is copied for theChild
. Not sure yet if I’ll implement overrides in v1 or v2. Overrides being ifParent
implementsdo_something()
andChild
does too, then the implementation ofParent
is not copied into theimpl
block.
That’s what I’ll try to tackle in the coming weeks.
tinkralge@programming.devOPto Programming@programming.dev•How would you store symlinks on a cloud service?English1·2 years agoJottacloud is what I want to use. Unlimited storage for ~100€/month
Close behind is 1fichier for 2€/TB/month or 12€/TB/year, but they are in France and “uptobox” (a similar provider) was shutdown by the US on French soil because they allowed providing links to the files.
You can probably find others in the list of storage systems supported by rclone
Blake 3 supports verified streaming as it is built upon merkle trees as you described. So is IPFS. As I mentioned, IPFS hashes are that of the tree, not the file contents themselves, but that doesn’t help when you have a SHA256 sum of a file and want to download it. Maybe there are networks that map the SHA256 sum to a blake3 sum, an IPFS CID, or even an HTTP URI, but I don’t know of one, hence the question here.
Do you know of a way to exploit that? A library maybe?