在比特币课程的第1周讲座中,讨论了加密哈希函数的3个属性:
碰撞阻力:如果找不到两个值x和y,使得x!= y,而H(x)= H(y),则认为散列函数H是抗碰撞的.
隐藏:哈希函数H隐藏如果:当从具有高熵的概率分布中选择秘密值r时,则给定H(r‖x),找到x是不可行的.‖表示两个字符串的连接.
益智友善.如果对于每个可能的n比特输出值y,如果从具有高熵的分布中选择k,则哈希函数H被认为是难以使用的,那么找到x使得H(k‖x)= y是不可行的.在时间上明显少于2 ^ n.
拼图友好似乎是一个更详细的隐藏描述.2之间有什么显着差异吗?哈希函数有1个属性,但不是两个?
默认情况下,Spring Boot会在我的src/main/webapp文件夹中查找我的html文件.如果我使用另一个文件夹放置html文件,我在哪里可以更改Spring Boot的设置?
稍后,文件将被包装在jar中以进行部署.还有其他我需要担心的事情吗?
鉴于我设置了一个带有索引动作的HomeController
class HomeController < ApplicationController
def index
@users = User.all
end
end
Run Code Online (Sandbox Code Playgroud)
并通过根路径路由到它,
root :to => "home#index"
Run Code Online (Sandbox Code Playgroud)
为什么这个请求规范失败了
it 'should called the home#index action' do
HomeController.should_receive(:index)
visit root_path
end
Run Code Online (Sandbox Code Playgroud)
以下消息
Failure/Error: HomeController.should_receive(:index)
(<HomeController (class)>).index(any args)
expected: 1 time
received: 0 times
Run Code Online (Sandbox Code Playgroud)
?是因为索引方法被调用为实例方法而不是类方法?
我无法理解语法中的错误.Bug.g4文件是:
grammar Bug;
text: TEXT;
WORD: ('a'..'z' | 'A'..'Z')+ ;
TEXT: ('a'..'z' | 'A'..'Z')+ ;
NEWLINE: [\n\r] -> skip ;
Run Code Online (Sandbox Code Playgroud)
运行antlr4和javac后,我跑了
grun Bug text -tree
aa
line 1:0 mismatched input 'aa' expecting TEXT
(text aa)
Run Code Online (Sandbox Code Playgroud)
但是如果我改为使用文字:语法中的WORD,那就没关系了.怎么了?
我正在阅读有关部署到EC2的内容.最后一步看起来像这样,我把bundle文件夹放在我的meteor项目之外
PORT=80 MONGO_URL=mongodb://localhost:27017/sidebar
ROOT_URL=http://ec2-23-20-113-59.compute-1.amazonaws.com/
sudo node ../bundle/main.js
Run Code Online (Sandbox Code Playgroud)
我用我的AWS控制台中显示的公共DNS替换ROOT_URL.我不太清楚MONGO_URL用什么,所以我通过命令启动流星
meteor
Run Code Online (Sandbox Code Playgroud)
看看流星使用的mongodb地址是什么,结果证明了这一点
mongodb://127.0.0.1:3002/meteor
Run Code Online (Sandbox Code Playgroud)
但是对于节点应用程序能够连接到mongodb,我必须保持流星应用程序运行.当它似乎正在工作时,控制台显示
listening
Run Code Online (Sandbox Code Playgroud)
我尝试使用公共DNS访问该站点,但它不起作用.所以我不知道接下来该做什么.
amazon-ec2 ×1
antlr ×1
blockchain ×1
capybara ×1
config ×1
controller ×1
cryptography ×1
deployment ×1
hash ×1
meteor ×1
mongodb ×1
rspec ×1
spring ×1