Class ByteUtils
java.lang.Object
pro.verron.officestamper.utils.ByteUtils
Utility class providing common operations for byte manipulation and conversions.
This class is not intended to be instantiated.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringreadableSize(byte[] imageBytes) Converts the size of a byte array into a human-readable string representation using standard size prefixes (e.g., KB, MB, GB).static Stringsha1b64(byte[] bytes) Computes the SHA-1 hash of the given input bytes and encodes the result in Base64.
-
Method Details
-
sha1b64
Computes the SHA-1 hash of the given input bytes and encodes the result in Base64.- Parameters:
bytes- the input byte array to be hashed.- Returns:
- the SHA-1 hash of the input bytes, encoded in Base64.
-
readableSize
Converts the size of a byte array into a human-readable string representation using standard size prefixes (e.g., KB, MB, GB).- Parameters:
imageBytes- the input byte array whose size needs to be converted- Returns:
- a human-readable string representing the size of the byte array in appropriate units (e.g., "1.2KB", "3.4MB")
-