def stringToBytes(value):
    """Coverts value in string to corresponding bytes representation.

    'hello' -> b'hello'
    'abc' -> b'abc'

    :type value: string
    :param value: the value
    :rtype: bytes
    :return: value in bytes
    """
    try:
        return bytes(map(ord, list(value)))
    except:
        raise TypeError('value is not of type string')
