| |
|
|
p.specht
| to input of (small) Maschinenprogrammen in XProfan-versions without Inline-Assembler suit itself u.a. long Hex-Strings with numbers in the area 0..9+A..F , per "word" bestehend each from 4 characters. circa Abstürze and Hacks To avoid, ought to one whom korrekten Transfer by a Prüfsumme confirm let. the nachstehende Machwerk generiert or. checks on a such, the ausgewertete String self is here only as example virtual.
Window Title "PRÜFSUMME FOR HEXSTRING"
Var c$="5589E58B75088B068B56042B46101b5614890689560431FF09D2790EFFC7F7D883d200F7DA89068956048B5E088B760C0"+\
"9F67909FFC7F7DB83d200F7DE751509DB745D89C189D031D2F7F387C8F7F3E9330000000fbdceFEC1530fadf30fadd0d3eaF7F389C3F7"+\
"E689C158568B7508F7E301CA720B3B5604770672063B067602FFCB5E31C989D8FFCF7507F7D883d100F7D98B7508894618894E1CE90E000000"+\
"31C0FFC8B9FFFFFF7FE9D9FFFFFF89EC5DC20400"
Declare p$,w&,s!,l%,m%
l%=Len(c$):Casenote l%:c$="0000"
l%=Len(c$):m%=l% Mod 4
If m%=1:c$=c$+"000"
ElseIf m%=2:c$=c$+"00"
ElseIf m%=3:c$=c$+"0"
EndIf
s!=1'<<< your salt
l%=Len(c$)
WhileLoop 0,l%-4,4
s!=s!+Val("$"+Mid$(c$,&Loop+1,4))
EndWhile
P$=stature$("%g",s!)
ClearClip:PutClip p$'<<< ought to in the Echtprogramm out!!!!!!!!!!!!
Print " HEXSTRING-PRÜFSUMME = ";P$
If P$="2980236":Print "\n PRÜFSUMME OK."
Else: Print "\n *** FEHLER: PRÜFSUMME STIMMT NOT! ***"
Sound 1300,400:WaitInput:End
EndIf
WaitInput 1000
Beep:Print "\n\n HAUPTPROGRAMM: CALL-commands would now statthaft!"
WaitInput
|
|
|
| Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 04/05/21 ▲ |
|
|
|