私はハッシュツリーを使用するP2Pアプリケーションに取り組んでいます。アーランハッシュツリー
私はハッシュツリー構築関数(publ/4とpubl_top/4)を書いていますが、publ_top/4を修正する方法はわかりません。私はPUBL/1でツリーを構築しようとし
:
nivd:publ("file.txt").
prints hashes...
** exception error: no match of right hand side value [67324168]
in function nivd:publ_top/4
in call from nivd:publ/1
コードの問題ではここにある:
あなたは問題があると思いますhttp://github.com/AndreasBWagner/nivoa/blob/886c624c116c33cc821b15d371d1090d3658f961/nivd.erl
?
は、私はあなたが空のリストと照合する最初の関数宣言では、特定の例外エラー
publ_top(_,[],Accumulated,Level) ->
%% Go through the accumulated list of hashes from the prior level
publ_top(string:len(Accumulated),Accumulated,[],Level+1);
publ_top(FullLevelLen,RestofLevel,Accumulated,Level) ->
case FullLevelLen =:= 1 of
false -> [F,S|T]=RestofLevel,
io:format("~w---~w~n",[F,S]),
publ_top(FullLevelLen,T,lists:append(Accumulated,[erlang:phash2(string:concat([F],[S]))]),Level);
true -> done
end.
を生成する1つの問題を見ることができ、 アンドレアスあなたのコードを見てみると
あなたは好奇心旺盛であれば、アプリがここで説明されています:のhttp://wiki.github
エラーは、おそらく何かのように、関数の引数に場合と同じパターンマッチを見つけるために容易になるだろう.com/AndreasBWagner/nivoa – andreasw