1Algorithm::CheckDigits:U:sMe1r0_C0o0n8t(r3i)buted Perl DAolcguomreintthamt:i:oCnheckDigits::M10_008(3)
2
3
4
6 CheckDigits::M10_008 - compute check digits for Sedol (GB)
7
9 use Algorithm::CheckDigits;
10
11 $sedol = CheckDigits('sedol');
12
13 if ($sedol->is_valid('0123457')) {
14 # do something
15 }
16
17 $cn = $sedol->complete('012345');
18 # $cn = '0123457'
19
20 $cd = $sedol->checkdigit('0123457');
21 # $cd = '7'
22
23 $bn = $sedol->basenumber('0123457');
24 # $bn = '012345'
25
27 Prior to March 2004 SEDOL codes solely consisted of numbers. Since
28 March 2004 SEDOL codes are a 7 character alphanumeric code.
29
30 The structure of the alphanumeric SEDOL codes is one alpha character
31 followed by 5 alphanumeric characters followed by the numerical check
32 digit.
33
34 Alpha characters are B-Z excluding vowels.
35 Alphanumerical characters are 0-9, B-Z excluding vowels.
36 Numerical Characters are 0-9.
37
38 No SEDOL code will be issued without the first alpha character. Active
39 numerical SEDOL codes issued prior to March 2004 remain valid.
40
41 ALGORITHM
42 0 All characters are assigned a numerical value from 0 to 35 where
43 the characters '0' to '9' get 0 to 9, 'B' to 'Z' get 11 to 35 with
44 the position of the vowels kept empty (for instance 'D' gets 13,
45 'F' gets 15).
46
47 1 Beginning left all numbers are weighted with 1,3,1,7,3,9 and 1
48 (checkdigit)
49
50 2 The sum of all products is computed.
51
52 3 The check digit is the difference of the sum from step 3 to the
53 next multiple of 10.
54
55 METHODS
56 is_valid($number)
57 Returns true only if $number consists solely of numbers and the
58 last digit is a valid check digit according to the algorithm given
59 above.
60
61 Returns false otherwise,
62
63 complete($number)
64 The check digit for $number is computed and concatenated to the end
65 of $number.
66
67 Returns the complete number with check digit or '' if $number does
68 not consist solely of digits and spaces.
69
70 This function always returns the SEDOL code in upper case.
71
72 basenumber($number)
73 Returns the basenumber of $number if $number has a valid check
74 digit.
75
76 Return '' otherwise.
77
78 This function always returns the SEDOL base number in upper case.
79
80 checkdigit($number)
81 Returns the checkdigit of $number if $number has a valid check
82 digit.
83
84 Return '' otherwise.
85
86 EXPORT
87 None by default.
88
90 Mathias Weidner, "<mamawe@cpan.org>"
91
93 perl, CheckDigits, www.londonstockexchange.com Masterfile technical
94 specifications V7.0.
95
96
97
98perl v5.32.0 2020-07-28Algorithm::CheckDigits::M10_008(3)