MD5在C中的嵌入式PLC上
我正在从事一个工作项目,该项目需要我将密码字符串转换为MD5哈希,并且遇到了麻烦。我知道MD5并不是为此目的最好的,但是我们正在做的不是问题,也是特别要求的。
背景- 我遇到麻烦,因为我编程的环境有点唯一。我正在自动化工作室4.9中的ANSI C中编程A B& r plc。大多数C功能都可以使用,但是标准库丢失了某些功能。例如,没有可用于格式化字符串的printf版本。我可以使用的最大整数数据类型是UDINT(在此环境中,变量遵循IEC的PLC数据类型,但这只是32位UINT)。这个环境也根本无法很好地处理功能指针,因此我需要尽力而为。我的大部分C编程经验都在这种环境中,因此试图在线查找C示例并使其工作非常困难。
最后,我需要一个.c和.h文件,并具有可以在多个项目之间使用的功能。输入将是一个字符串,输出是哈希字符串。
如果有人可以帮助我实现这一目标,那将不胜感激。如果我能提供任何其他信息,请告诉我。我知道这是一个罕见的问题。
I'm working on a project for work that requires me to convert password strings to MD5 hash and I'm having trouble. I know MD5 isn't the best for this purpose, but for what we're doing it isn't a problem and its been specifically requested.
Background-
I'm having trouble because the environment I'm programming in is a bit unique. I am programming a B&R PLC in ANSI C in Automation Studio 4.9. Most C functionality is available, but certain functions are lost from the standard libraries. For example there's no version of printf available for formatting strings. the largest integer data type I can use is a UDINT (variables in this environment follow IEC's plc datatypes, but it's just a 32 bit uint). This environment also does not handle function pointers well at all, so I need to avoid them the best I can. The majority of my C programming experience has been in this environment so trying to find C examples online and make them work is very difficult.
In the end I need a .c and .h file with functions that I can use between multiple projects. The input will be a string and the output is the hash string.
If anybody can help me accomplish this, it would be much appreciated. If I can provide any additional information let me know. I know this is an uncommon problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论