MD5Lib provides a MD5 digest generation FB for Sysmac Studio. OMRON's Sysmac Studio is required to view and execute the code.
Sysmac Studio Version 1.60
git clone
this repository or download the zip.- Reference "MD5Lib.slr" in your project.
Also check "MD5LibExample.smc2".
git clone
this repository or download the zip.- Open "MD5LibExample.smc2" in Sysmac Studio.
- Check "POU/Program/README".
- Build the project.
- Execute on simulator or actual machine.
"MD5LibExample.smc2" includes "MD5Lib.slr".
MD5Lib provides MD5 digest generation FB. FB generates a digest from an input sequence of bytes.
CASE iState OF
0:
iMessage := 'abc'; // 900150983cd24fb0d6963f7d28e17f72
iBinMessageSize := StringToAry(In:=iMessage,
AryOut:=iBinMessage[0]);
iBinMessageHead := 0;
iMD5StreamDigest(Execute:=FALSE,
Stream:=iBinMessage,
StreamHead:=iBinMessageHead);
Inc(iState);
1:
WHILE NOT iSHA1StreamDigest.Done DO
iMD5StreamDigest(Execute:=TRUE,
Stream:=iBinMessage,
StreamHead:=iBinMessageHead,
StreamSize:=iBinMessageSize,
HashStr=>iHashStr);
END_WHILE;
Inc(iState);
END_CASE;
I recommend checking the hash value of the acquired Sysmac Studio project.
file | sha256 |
---|---|
MD5Lib.slr | e5cc06eb60064fcb8424250985e517f98dd4a151374fabe85d02fbc92254d442 |
MD5LibExample.scm2 | cd6ce3e08caa88e2517777bafd0c1e258eb24952c924d9daa5f872d084e93efd |