9 lines
329 B
Text
9 lines
329 B
Text
fcn checksum(text){
|
|
( text.len()!=6 or (text..matches("*[AEIOUaeioua-z]*")) ) and
|
|
throw(Exception.ValueError("Invalid SEDOL text: "+text));
|
|
|
|
text + (10 - text.pump(List,'wrap(c){
|
|
if("0"<=c<="9") c.toAsc()-0x30;
|
|
else c.toAsc()-55;
|
|
}).zipWith('*,T(1,3,1,7,3,9)).sum() % 10) % 10;
|
|
}
|