Change tag database format to json for better maintainability

This commit is contained in:
FooIbar authored and tarsin committed 2022-12-15 11:38:32 +08:00
1 parent 55c7f6b896
commit 11d3799b03
5 files changed
+73 -170

No files matched your search

@@ -39,4 +39,23 @@ public class HashCodeUtils {
}
return hash;
}
/**
* http://stackoverflow.com/questions/332079
*
* @param bytes The bytes to convert.
* @return A {@link String} converted from the bytes of a hashable key used
* to store a filename on the disk, to hex digits.
*/
public static String bytesToHexString(final byte[] bytes) {
final StringBuilder builder = new StringBuilder();
for (final byte b : bytes) {
final String hex = Integer.toHexString(0xFF & b);
if (hex.length() == 1) {
builder.append('0');
}
builder.append(hex);
}
return builder.toString();
}
}