I wrote:
> sn =. '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' NB. SEDOL
> numerals
> acs0 =. (,. 10 | 10 - 10 | 1 3 1 7 3 9 +/@:*"1 ])&.(sn&i.) NB.
> Append checksum
Then refined (thanks to Raul):
> acs1 =. (, 10 | 0 - 1 3 1 7 3 9 +/@:* ])&.(sn i. |:)
One more refinement:
acs2 =. (, 10 | 1 3 1 7 3 9 +/@:* -)&.(sn i. |:)
Though this version is a bit slower than the previous acs1 I prefer it.
There is no fat left to cut.
-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm