Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/SEDOLs/AutoHotkey/sedols-1.ahk
Normal file
19
Task/SEDOLs/AutoHotkey/sedols-1.ahk
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
codes = 710889,B0YBKJ,406566,B0YBLH,228276,B0YBKL,557910,B0YBKR,585284,B0YBKT,B00030,ABCDEF,BBBBBBB
|
||||
Loop, Parse, codes, `,
|
||||
output .= A_LoopField "`t-> " SEDOL(A_LoopField) "`n"
|
||||
Msgbox %output%
|
||||
|
||||
SEDOL(code) {
|
||||
Static weight1:=1, weight2:=3, weight3:=1, weight4:=7, weight5:=3, weight6:=9
|
||||
If (StrLen(code) != 6)
|
||||
Return "Invalid length."
|
||||
StringCaseSense On
|
||||
Loop, Parse, code
|
||||
If A_LoopField is Number
|
||||
check_digit += A_LoopField * weight%A_Index%
|
||||
Else If A_LoopField in B,C,D,F,G,H,J,K,L,M,N,P,Q,R,S,T,V,W,X,Y,Z
|
||||
check_digit += (Asc(A_LoopField)-Asc("A") + 10) * weight%A_Index%
|
||||
Else
|
||||
Return "Invalid character."
|
||||
Return code . Mod(10-Mod(check_digit,10),10)
|
||||
}
|
||||
17
Task/SEDOLs/AutoHotkey/sedols-2.ahk
Normal file
17
Task/SEDOLs/AutoHotkey/sedols-2.ahk
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
MsgBox % SEDOL("710889") ;7108899
|
||||
MsgBox % SEDOL("B0YBKJ") ;B0YBKJ7
|
||||
MsgBox % SEDOL("406566") ;4065663
|
||||
MsgBox % SEDOL("B0YBLH") ;B0YBLH2
|
||||
MsgBox % SEDOL("228276") ;2282765
|
||||
MsgBox % SEDOL("B0YBKL") ;B0YBKL9
|
||||
MsgBox % SEDOL("557910") ;5579107
|
||||
MsgBox % SEDOL("B0YBKR") ;B0YBKR5
|
||||
MsgBox % SEDOL("585284") ;5852842
|
||||
MsgBox % SEDOL("B0YBKT") ;B0YBKT7
|
||||
|
||||
SEDOL(w) {
|
||||
static weights := [1,3,1,7,3,9]
|
||||
loop parse, w
|
||||
s += ((c := Asc(A_LoopField)) >= 65 ? c - 65 + 10 : c - 48) * weights[A_Index]
|
||||
return w Mod(10 - Mod(s, 10), 10)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue