public static EncodeFingerprint ( int fp, int algorithm, bool base64 ) : byte[] | ||
fp | int | pointer to an array of 32-bit integers representing the raw fingerprint to be encoded |
algorithm | int | Chromaprint algorithm version which was used to generate the raw fingerprint |
base64 | bool | Whether to return binary data or base64-encoded ASCII data. The /// compressed fingerprint will be encoded using base64 with the URL-safe scheme if you /// set this parameter to 1. It will return binary data if it's 0. |
return | byte[] |
public static byte[] EncodeFingerprint(int[] fp, int algorithm, bool base64)
{
FingerprintCompressor compressor = new FingerprintCompressor();
string compressed = compressor.Compress(fp, algorithm);
if (!base64)
{
return Base64.ByteEncoding.GetBytes(compressed);
}
return Base64.ByteEncoding.GetBytes(Base64.Encode(compressed));
}