def str2cryptofunction(crypto_function_description):
s = crypto_function_description.split('<STR_LIT:->')<EOL>if len(s) != <NUM_LIT:3>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if s[<NUM_LIT:0>] != HOTP:<EOL><INDENT>raise ValueError('<STR_LIT>' % s[<NUM_LIT:0>])<EOL><DEDENT>algo = str2hashalgo(s[<NUM_LIT:1>])<EOL>try:<EOL><INDENT>truncation_length = int(s[<NUM_LIT:2>])<EOL>if truncation_length < <NUM_LIT:0> or truncation_length > <NUM_LIT:10>:<EOL><INDENT>raise ValueError()<EOL><DEDENT><DEDENT>except ValueError:<EOL><INDENT>raise ValueError('<STR_LIT>' % s[<NUM_LIT:2>])<EOL><DEDENT>return CryptoFunction(algo, truncation_length)<EOL>
Convert an OCRA crypto function description into a CryptoFunction
instance

:param crypto_function_description:
:returns:
    the CryptoFunction object
:rtype: CryptoFunction