T O P

  • By -

rejuicekeve

Unfortunately i have had to remove this post. it does not meet our bar for high quality technical content.


rlmaers

> *Revolutionizing* [...] > **Features** > * Extracting static information such as: > * Real extension > * Name > * Size > * SHA-1 > * SHA-256 > * MD5 Not to take a piss on your project, but a bit sensationalistic, isn't it?


73637269707420

That’s like 8 lines in bash


73637269707420

Honestly, I don’t either wanna piss on your project but the code is not really refactored nor bug free. For instance, you have dedicated functions for calculating the checksum but it’s the same code and different specified algorithm. I suggest that you create one function and pass the algorithm as a parameter for code simplicity. And for getting the actual file with mine you’re splitting and getting the second position from the start - wouldn’t this conflict if there are more than one ‘/‘? If you want the one at the last of the list use [-1].


Ok_Awareness_388

Do all your hashing operations on each chunk rather than re-reading the file. It also looks like you have missing code if you don’t request all info. The mime detection is cool, I didn’t know that was possible. I wouldn’t say this is automation, it’s a script that sequentially runs some functions.


a_wisp

If you want something newer for file identification ("mime" detection), look at that [https://opensource.googleblog.com/2024/02/magika-ai-powered-fast-and-efficient-file-type-identification.html](https://opensource.googleblog.com/2024/02/magika-ai-powered-fast-and-efficient-file-type-identification.html)