File Extensions
You can easily get the hash of a file using the method below. The parameter algorithm is used to define which should be used for the hash, the default is SHA-256.
File.hash()
If you need to hold a reference to a file at a remote location you can use the RemoteFile class provided here. This allows you to easily get the hash of a remote file with RemoteFile#hash.
This is particularly useful when used in parallel with our other open-source library, resource-pack-deploy, so you can get the hash of the latest resource pack file, and use it to reset a client's cached version of your resource pack if there are any differences.
Last modified: 21 February 2024