用于计算校验位的输入的技术术语是什么?
例如:
code = '7777-5';
input = code.substring(0, 4); // Returns '7777'
checkdigit = f(input); // f() produces a checkdigit
assert.areEqual(code, input + "-" + checkdigit)
上面使用的input
有技术术语吗?
具体来说,我正在计算ISBN的校验位,但这不应该影响答案。
For example:
code = '7777-5';
input = code.substring(0, 4); // Returns '7777'
checkdigit = f(input); // f() produces a checkdigit
assert.areEqual(code, input + "-" + checkdigit)
Is there a technical term for input
used above?
Specifically I'm calculating checkdigits for ISBNs, but that shouldn't effect the answer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“不含校验位的原始数字”技术性够吗? :)
实际上,通常情况下,如您发布的链接中所示,校验位或校验和确保有关完整输入的属性:
因此,您需要检查完整的数字看看它是否满足这个属性。
当您最初生成校验位时,它是“向后”的。在这种情况下,该函数将被命名为generate_check_digit或类似的,我只是将其参数命名为“input”。
Is "original number excluding the check digit" technical enough? :)
Actually, it's often the case, as in the link you posted, that the check digit or checksum ensures a property about the full input:
Thus, you'd check the full number and see if it meets this property.
It's "backwards" when you're initially generating the check digit. In that case, the function would be named generate_check_digit or similar, and I'd just name its parameter as "input".
虽然我不确定输入是否有一个众所周知的特定技术术语,但 LukeH 建议的(消息/数据)似乎很常见。
校验和的 Wiki:
Wiki for 校验位:
Although I am not sure if there is a well-known specific technical term for the input, what LukeH suggested (message/data) seems common enough.
Wiki for checksum:
Wiki for check digit: