Compartir a través de


Compress

Crypt.Compress

Given a string, compresses the string into a double-byte representation of the same string.

Syntax

Function Crypt.Compress(bstrIn) As String

Parameters

  • bstrIn
    A string containing the data to be compressed.

Return values

The same string after compression.

Example

For an example of this method, see Crypt.Decrypt.

Remarks

The Compress method is usually called before calling Encrypt because a compressed string will save space on the query string or in storage.

This method is intended primarily for use with low ASCII strings like the ones produced by the Microsoft .NET Passport encryption algorithm.

The strings sent in the kppvc query string parameter for Microsoft® Kids Passport account verification will already be compressed in this manner. The Compress method is provided with the companion method Decompress. The .NET Passport server-side usage of the Compress method only compresses regular ASCII characters. Compressing strings that are not entirely composed of regular ASCII and contain extended characters or Unicode is not supported by the Compress method; such strings may not be properly decompressed.

Typically, this method is used in conjunction with the Encrypt, Decrypt, and Decompress methods. The example shown in the Decrypt method uses these four methods together.

See Also

Passport Crypt Object | Crypt.Decompress | Crypt.Encrypt