gpt4 book ai didi

iso8583 - 将消息从 ASCII 转换为 HEX ISO8583.net

转载 作者:行者123 更新时间:2023-12-02 13:29:33 25 4
gpt4 key购买 nike

我的计费提供商需要获取十六进制格式的消息,而不是 ASCII 格式的消息,例如,我发送了一条 800 消息,流是:

42 00 30 38 30 30 a2 38 00 00 00 80 80 00 04 00

00 00 00 00 00 00 39 30 30 30 30 30 30 34 30 32

31 34 33 31 31 38 31 37 33 31 31 38 31 37 33 31

31 38 30 34 30 32 31 32 33 34 35 36 37 38 39 39

38 30 30 31

我可以使用该项目将消息创建为十六进制而不是 ASCII 吗?我是否只需要在发送消息之前转换消息(并在返回消息时转换回来)?

非常感谢您在此事上的帮助

最佳答案

您可以更改字段、位图和消息类型的格式化程序。

查看Template类中的项目源代码。您需要创建自己的类来扩展 Iso8583,并创建自己的具有 ASCII 位图和消息类型格式化程序的模板。

从 0.5.1 版本开始,您可以执行以下操作

public class AsciiIso : Iso8583
{
private static readonly Template template;

static AsciiIso()
{
template = GetDefaultIso8583Template();
template.BitmapFormatter = Formatters.Ascii;
template.MsgTypeFormatter = Formatters.Ascii;
}

public AsciiIso() : base(template)
{
}
}

关于iso8583 - 将消息从 ASCII 转换为 HEX ISO8583.net,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9980401/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com