class ResolvedFunction {

    public QualifiedName toQualifiedName()
    {
        byte[] json = SERIALIZE_JSON_CODEC.toJsonBytes(this);

        // json can be large so use zstd to compress
        ZstdCompressor compressor = new ZstdCompressor();
        byte[] compressed = new byte[toIntExact(compressor.maxCompressedLength(json.length))];
        int outputSize = compressor.compress(json, 0, json.length, compressed, 0, compressed.length);

        // names are case insensitive, so use base32 instead of base64
        String base32 = base32Hex().encode(compressed, 0, outputSize);
        // add name so expressions are still readable
        return QualifiedName.of(PREFIX + signature.getName() + PREFIX + base32);
    }

    @JsonCreator public  ResolvedFunction(
            @JsonProperty("signature") BoundSignature signature,
            @JsonProperty("id") FunctionId functionId,
            @JsonProperty("typeDependencies") Map<TypeSignature, Type> typeDependencies,
            @JsonProperty("functionDependencies") Set<ResolvedFunction> functionDependencies);

}