小编ram*_*ram的帖子

使用AND运算符的基于Elasticsearch URI的查询

如何在基于URI的查询中指定AND操作?我正在寻找类似的东西:

http://localhost:9200/_search?q="profiletype:student AND username:s*"
Run Code Online (Sandbox Code Playgroud)

elasticsearch

27
推荐指数
3
解决办法
4万
查看次数

为什么浏览器有3个字符作为协议分隔符?

http:// vs http:

要么有一些历史原因,要么我错过了一些东西.

browser uri

5
推荐指数
1
解决办法
290
查看次数

在 Erlang 中解码 PGP 密钥

我无法在 Erlang 中“pem_entry_decode”GPG 公钥。通过 OpenSSL 生成的公钥工作正常。我已经按照Erlang - Importing GPG Public Key 中的建议修复了 GPG 密钥。

#!/usr/local/bin/escript

main(_) ->
  [application:start(X) || X <- [crypto, public_key, ssl]],
  Msg = list_to_binary("Hello World!"),
  %{ok, FileContents} = file:read_file("public_openssl.pem"),
  {ok, FileContents} = file:read_file("public_gpg.asc"),
  show(FileContents),
  [Entry] = public_key:pem_decode(FileContents),
  show(Entry),
  Key = public_key:pem_entry_decode(Entry),
  show(Key),
  EM = public_key:encrypt_public(Msg, Key),
  show(EM).

show(Something) ->
  io:format("~p~n", [Something]).
Run Code Online (Sandbox Code Playgroud)

错误:

escript: exception error: no match of right hand side value 
                 {error,
                     {asn1,
                         {wrong_tag,
                             {{expected,16},{got,131097,{131097,<<"\r">>}}}}}}
  in function  public_key:der_decode/2 (public_key.erl, line 170)
  in call from …
Run Code Online (Sandbox Code Playgroud)

erlang gnupg openpgp

5
推荐指数
1
解决办法
1043
查看次数

标签 统计

browser ×1

elasticsearch ×1

erlang ×1

gnupg ×1

openpgp ×1

uri ×1