benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf a6ee06d7-ddf5-58e8-bcdf-b9c8093a8f72

Problem

Answer published by the source. Consult the official source to check your work against its answer.

complete prompt

import binascii
import io
import gzip

def task_func(compressed_hex):
    """
    Uncompress a gzip-compressed hexadecimal string and decrypt the result to UTF-8.
    
    Parameters:
    - compressed_hex (str): The gzip-compressed hexadecimal string.
    
    Returns:
    - decoded_string (str): The decoded and decompressed string in UTF-8 format, or an error message.
    
    Requirements:
    - binascii
    - io
    - gzip
    
    Example:
    >>> task_func('1f8b08000000000002ff0b49494e55560304000000ffff8b202d0b000000')
    'Error during decompression: CRC check failed 0xff000000 != 0x41449975'
    """

instruct prompt

Uncompress a gzip-compressed hexadecimal string and decrypt the result to UTF-8.
The function should output with:
    decoded_string (str): The decoded and decompressed string in UTF-8 format, or an error message.
You should write self-contained code starting with:

Code

import binascii
import io
import gzip
def task_func(compressed_hex):

code prompt

Code

import binascii
import io
import gzip
def task_func(compressed_hex):

entry point

task_func

libs

  • io
  • gzip
  • binascii

Discussion

Discussion

No discussion posts on this page yet. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

Source and history

Official source

initial import