如何计算 REBOL 3 模块校验和?

发布于 2024-08-06 20:45:39 字数 707 浏览 3 评论 0原文

在 REBOL 3 中可以计算 SHA1 模块校验和。当 REBOL 加载模块时,它将其校验和与加载模块的校验和进行比较,如果两者不匹配,则会生成错误,即。 访问错误:校验和无效(文件被篡改)

无论我如何尝试,我似乎都无法创建 REBOL 3 喜欢的模块校验和。当我查看 import 的文档时,其 /check 细化表示使用 mold/flatchecksum/secure >。我尝试过各种变体,但没有成功:

import/check %module.r checksum/secure to-binary mold/flat load/all %module.r
import/check %module.r checksum/secure to-binary mold/flat load %module.r
import/check %module.r checksum/secure to-binary mold/only/flat load/all %module.r
import/check %module.r checksum/secure to-binary mold/only/flat load %module.r
import/check %module.r checksum/secure read %module.r

等等。这些都不起作用。我一定做错了一些简单的事情。

It's possible in REBOL 3 to calculate a SHA1 module checksum. When REBOL loads a module, it compares its checksum against the checksum of the loaded module, and if the two do not match, an error is generated, viz. access error: invalid checksum (tampered file).

No matter how I try, I can't seem to create a module checksum that REBOL 3 likes. When I look at the documentation for import, its /check refinement says to use checksum/secure of mold/flat. I've tried all sorts of variations of this with no luck:

import/check %module.r checksum/secure to-binary mold/flat load/all %module.r
import/check %module.r checksum/secure to-binary mold/flat load %module.r
import/check %module.r checksum/secure to-binary mold/only/flat load/all %module.r
import/check %module.r checksum/secure to-binary mold/only/flat load %module.r
import/check %module.r checksum/secure read %module.r

and so on. None of it works. There's got to be some simple thing I'm doing wrong.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你如我软肋 2024-08-13 20:45:39

答案是:

import/check %module.r checksum/secure to-binary mold/flat load/unbound/header %module.r

当然,通常您会预先计算校验和并将其用作文字,否则它作为安全检查不会对您有多大帮助:

import/check %module.r #{A3CD837D0CF843302221C074E88A64AA0147E07E}

Here is the answer:

import/check %module.r checksum/secure to-binary mold/flat load/unbound/header %module.r

Of course, ordinarily you would pre-calculate the checksum and use it as a literal, otherwise it wouldn't do you much good as a security check:

import/check %module.r #{A3CD837D0CF843302221C074E88A64AA0147E07E}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文