You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cool project. I was wondering about the option of adding a bool for a byte[] bool = SmazSharp.CanDecode(input byte[]), and a compression ratio value. int ratio = SmazSharp.CompressionRatio(string input)
Thanks
Dave
The text was updated successfully, but these errors were encountered:
Both of those suggestions would largely involve performing the actual compression/decompression. Presumably (depending on the output), you might then choose to perform the operation (or not?). It might be best to perform the compression/decompression and calculate the ratio yourself (as its meaning is a little complicated - see below).
While the source hasn't been optimised for allocations, it should be possible to have an allocation-free ratio calculator (if that's what you're worried about):
This is slightly complicated, as the string type in .Net is in Unicode encoding, but Smaz only compresses ASCII. Should the ratio be compared to an ASCII encoded string, or it's Unicode? Is the size equal to the number of characters in the string, or the number of bytes it occupies?
Regarding, the SmazSharp.CanDecode suggestion, how do you feel about the try pattern? For example:
Hello there,
Cool project. I was wondering about the option of adding a bool for a byte[] bool = SmazSharp.CanDecode(input byte[]), and a compression ratio value. int ratio = SmazSharp.CompressionRatio(string input)
Thanks
Dave
The text was updated successfully, but these errors were encountered: