TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Learn Rust by implementing a SHA-1 hash cracker

68 点作者 sylvain_kerkour超过 2 年前

4 条评论

mprovost超过 2 年前
This is a good intro and really highlights how Rust doesn&#x27;t have a learning curve, it has a cliff. I&#x27;m tackling this in my own book [0] because I think the docs really throw you in the deep end (mixing metaphors). As this article shows, to implement a &quot;hello world&quot; you have to use a macro, so you can&#x27;t even look for a function signature in the standard library docs to help. So you can either just say &quot;don&#x27;t worry about this for now, just trust me&quot; or spend a whole chapter diving into macro syntax. And then it goes into errors, which in this example need to be boxed, so then you can spend a bunch of time explaining unsized types and boxing and memory allocation... or just say that it has to be boxed to keep the compiler happy.<p>Teaching Rust is basically a giant topological sorting exercise [1] where you&#x27;re finding the optimal order to introduce syntax so that you steer clear of all of these rabbit holes. Or you just end up drawing the owl.<p>[0] <a href="https:&#x2F;&#x2F;rftgu.rs&#x2F;" rel="nofollow">https:&#x2F;&#x2F;rftgu.rs&#x2F;</a> [1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Topological_sorting" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Topological_sorting</a>
stefs超过 2 年前
the title is a bit misleading IMO; it doesn&#x27;t generate a collision, it just generates a rainbow table and looks for matches on the fly.
评论 #33023344 未加载
nailer超过 2 年前
Seems standard enough, learning that a Vector is a resizable Array was needed, the auto closing sockets and files is cool. But what on Earth is string.into() ?<p>Not asking for an answer just pointing out that’s not a very useful name.
评论 #33022324 未加载
评论 #33022241 未加载
评论 #33024021 未加载
评论 #33022218 未加载
Thaxll超过 2 年前
It&#x27;s very strange for main to return something, the logic should be wrapped in a different function and the error checking done from main.
评论 #33023425 未加载
评论 #33022528 未加载
评论 #33022716 未加载
评论 #33023953 未加载