ASP.NET 将字符串转换为预定义长度字符串
在工作中,我们正在转换为新的支付系统,该系统仅允许产品代码中最多包含 7 个字符。我们使用的产品代码可以并且将会超过 7 个字符(更改需要更改过去的订单,因此更改代码是不可能的)。
我们的产品代码是事件代码(即ccsws2011),旧系统允许我们传递整个事件代码,而新系统限制我们只能输入7个字符。我根本不想查表。我希望能够为系统(网站外)创建一个产品代码列表,然后让网站内的代码自动将我们的活动代码转换为我在网站外创建的产品代码,并将其传递到支付系统。
有没有办法将我们的产品代码哈希为新系统的 7 个字符的产品代码?
IE:
我们的产品代码:ccsws2011 哈希产品代码:xxxxxxx
Here at work we are converting over to a new payment system which allows only a maximum of 7 characters in the product code. The product codes we are using can and will excede 7 characters (changing would require changing past orders so changing the codes is out of the question).
The product code for us is the event code (ie ccsws2011), the old system allowed us to pass the entire event code in, whereas the new system is limiting us to only 7 characters. I do not want to do a look up table at all. I want to be able to create a product code list for the system (outside the website) and then have the code within the website automatically convert our event code to the product code I created outside the website and pass it to the payment system.
Is there a way to hash our product code into a 7 character product code for the new system?
I.E.:
our product code: ccsws2011
Hashed product code: xxxxxxx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
感谢大家的努力,我们决定使用另一个值作为项目代码,从而解决了这个问题。再次感谢大家
Thanks for your efforts everyone, another value was decided upon to be used for the item code which nullified this issue. Thank you again everyone