I have a function gen_seq
that return a random generated integer of length n
e.g.
gen_seq(5); // return a randomly generated int of length n, e.g. 12345
Now, I want a simple function that in append the checksum the end of function
get_seq_with_checksum(5); // return 12345[28]
is_valid_seq(n); // check if a given string is valid according to the input function
- What would be a good fit algorithm pairs for function
get_seq_with_checksum
&is_valid_seq
?