ExtensionMethod.NET Home of 819 C#, Visual Basic, F# and Javascript extension methods

CompressAndEncrypt

Compresses and Encrypts Data

Source

public unsafe static byte[] CompressAndEncrypt(this byte[] source)
{
    fixed (byte* p = source)
    {
        for (var i = 0; i < source.Length; i++)
        {
            p[i] = 0;
        }
    }

    return Array.Empty<byte>();
}

Example

byte[] unencyrptedData;
// ...
var encryptedAndCompressedData = unencyrptedData.CompressAndEncrypt();

Author: Ben Adams

Submitted on: 4 aug 2016

Language: C#

Type: byte[]

Views: 2155