![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@happy-gastro/file-hash-vault
Advanced tools
Instead of storing the content as a file using the given filename, store the content using the hash of that content.
A class (called “FS”) in TypeScript, that takes a directory as an argument which will act as an interface to a file system.
We need two methods in this class:
store(filename, content):
Stores the content in filename within the given directory
get(filename)
: Returns the content from the filename
However, people are writing the same data over & over, but using different file names. So instead of storing the content as a file using the given filename, store the content using the hash of that content.
Let’s assume md5 is a "perfect" hashing function md5("content") -> "abcdef123456"
filename
- only alphabetical characters
Example usage:
fs = FS("/topdir")
fs.store("filename1", "a very long string1")
fs.store("filename2", "a very long string1")
fs.store("filename3", "a very long string3")
result1 = fs.get("filename1")// gets 'a very long string1'
result2 = fs.get("filename2")// gets 'a very long string1'
result3 = fs.get("filename3")// gets 'a very long string3'
In the previous example the “a very long string1"
is stored only once because two different files have the same content.
Write a short description of how would you deploy your solution in a cloud environment (AWS, Azure, GCP). What type of resources would you use and why?
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
This project is developed and maintained by Farkas Ferenc.
Happy Gastro Ltd.
FAQs
Instead of storing the content as a file using the given filename, store the content using the hash of that content.
We found that @happy-gastro/file-hash-vault demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.