@staticmethod<EOL><INDENT>def next_tag(base_dir: str, cd_id: str) -> (str, int):<DEDENT>
tag = <NUM_LIT:1> + max([int(rev_reg_id2tag(basename(f)))<EOL>for f in Tails.links(base_dir) if cd_id in basename(f)] + [-<NUM_LIT:1>])  <EOL>size = min(<NUM_LIT:2>**(tag + <NUM_LIT:8>), <NUM_LIT>)<EOL>return (tag, size)<EOL>
Return the next tag name available for a new rev reg id on input cred def id in base directory,
and suggested size of associated rev reg.

:param base_dir: base directory for tails files, thereafter split by cred def id
:param cd_id: credential definition identifier of interest
:return: stringified least non-negative integer not yet used in a rev reg id associated with a tails file
    in base directory, and recommendation for next size to use