def ipv6_prefix_to_mask(prefix):
if prefix > <NUM_LIT> or prefix < <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>mask = ((<NUM_LIT:1> << <NUM_LIT>) - <NUM_LIT:1>) ^ ((<NUM_LIT:1> << (<NUM_LIT> - prefix)) - <NUM_LIT:1>)<EOL>f = <NUM_LIT:15>  <EOL>hex_mask_str = '<STR_LIT>'<EOL>for i in range(<NUM_LIT:0>, <NUM_LIT:32>):<EOL><INDENT>hex_mask_str = format((mask & f), '<STR_LIT:x>') + hex_mask_str<EOL>mask = mask >> <NUM_LIT:4><EOL>if i != <NUM_LIT> and i & <NUM_LIT:3> == <NUM_LIT:3>:<EOL><INDENT>hex_mask_str = '<STR_LIT::>' + hex_mask_str<EOL><DEDENT><DEDENT>return hex_mask_str<EOL><DEDENT>
ipv6 cidr prefix to net mask

:param prefix: cidr prefix, rang in (0, 128)
:type prefix: int
:return: comma separated ipv6 net mask code,
         eg: ffff:ffff:ffff:ffff:0000:0000:0000:0000
:rtype: str