Note: The above example and the one that follows does not include a CDTOC with a CD Extra Data Track or Playstation type data track. These would require additional calculations.
To convert a CDTOC (that contains start positions for audio tracks only + lead-out) to CTDB TOCID
CDTOC: B+96+691B+B5BF+131E0+19279+1DDD5+255A9+2C2BD+331D1+39E69+3FA29+490D6
Subtract the first start position (96) from all (e.g. 691B - 96 = 6885)
6885+B529+1314A+191E3+1DD3F+25513+2C227+3313B+39DD3+3F993+49040
Create a string with each position represented as 4 byte hex and appended to the previous
000068850000B5290001314A000191E30001DD3F000255130002C2270003313B00039DD30003F99300049040
pad (with zeroes) so there are a total of 100 4 byte hex strings represented
000068850000B5290001314A000191E30001DD3F000255130002C2270003313B00039DD30003F993000490400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Create a SHA-1 hash of that 800 character string
8f06c2212f00952ab3112ec2ad5c10fb56df8684
Convert that string to a RFC 4648 Base64 string of printable ASCII characters (28 characters)
jwbCIS8AlSqzES7CrVwQ+1bfhoQ=
Change
any '+' to a '.'
any '/' to a '_'
any '=' to a '-'
jwbCIS8AlSqzES7CrVwQ.1bfhoQ-
Here's one with a data track after the audio (hex A=10 tracks but there are 12 start positions)
A+96+693C+BD03+11663+16F30+1CE6C+22303+22925+28C49+2ECD9+388C4+42D0D
The start position of the data track is not equal to the last frame of the audio +1. In this example, in addition to subtracting the first track start position, you need to subtract an additional 11400 frames (11250 frames for lead-out/lead-in + 150 frames of pre-gap) from that value. That's 2C88 in hex. AND you don't need the lead-out start position from the data track (42D0D). The CTDB TOCID calculation only uses audio positions.
693C - 96 = 68A6
[...]
388C4 - 96 - 2C88 = 35BA6
68A6+BC6D+115CD+16E9A+1CDD6+2226D+2288F+28BB3+2EC43+35BA6
000068A60000BC6D000115CD00016E9A0001CDD60002226D0002288F00028BB30002EC4300035BA6
000068A60000BC6D000115CD00016E9A0001CDD60002226D0002288F00028BB30002EC4300035BA6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
SHA-1
3327ff840208f20238033eca541419e62c05ed65
Base64
Myf/hAII8gI4Az7KVBQZ5iwF7WU=
+ / = characters converted to _ . -
Myf_hAII8gI4Az7KVBQZ5iwF7WU-