def _dtype_to_pack_info(dtype):
    """Get information from data type string for pack and unpack.

    Parameters
    ----------
    dtype : str
        One of the following string values: 'char', 'short', 'int', 'float',
        'double'.

    Returns
    -------
    c : str
        Format character.

    size : int
        Size required by the format.

    """

    dic = {
        'char' : ('c', 1),
        'short' : ('h', 2),
        'int' : ('i', 4),
        'float' : ('f', 4),
        'double' : ('d', 8),
    }

    if dtype not in dic.keys():
        raise NotImplementedError('Unexpected data type: ' + dtype)
    return dic[dtype]