mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-24 23:25:19 +00:00
LZ4 -> ZLIB (#452)
This commit is contained in:
@@ -27,7 +27,7 @@ struct CompressionUtil {
|
||||
return compression_encode_buffer(
|
||||
destinationBuffer, data.count,
|
||||
sourcePtr, data.count,
|
||||
nil, COMPRESSION_LZ4
|
||||
nil, COMPRESSION_ZLIB
|
||||
)
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ struct CompressionUtil {
|
||||
return compression_decode_buffer(
|
||||
destinationBuffer, originalSize,
|
||||
sourcePtr, compressedData.count,
|
||||
nil, COMPRESSION_LZ4
|
||||
nil, COMPRESSION_ZLIB
|
||||
)
|
||||
}
|
||||
|
||||
@@ -72,4 +72,4 @@ struct CompressionUtil {
|
||||
let uniqueByteRatio = Double(byteFrequency.count) / Double(min(data.count, 256))
|
||||
return uniqueByteRatio < 0.9 // Compress if less than 90% unique bytes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user