Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Hash Tree
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
HORINOUCHI Masato
November 10, 2015
Technology
80
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Hash Tree
社内LT大会 0x64物語 #02 Data Structure 資料
HORINOUCHI Masato
November 10, 2015
More Decks by HORINOUCHI Masato
See All by HORINOUCHI Masato
balenaCloud
thermes
0
93
Church Numerals
thermes
0
53
CPS & CTO
thermes
0
250
FM synthesis
thermes
0
39
A440
thermes
0
65
Inside mml2wav.rb
thermes
0
91
Scheme Interpreter in Ruby
thermes
0
72
Clock / Timer
thermes
0
170
POSIX Threads
thermes
0
59
Other Decks in Technology
See All in Technology
手塩にかけりゃいいってもんじゃない
ming_ayami
0
470
エラーバジェットのアラートのタイミングを考える.pdf
kairim0
0
130
就職⽀援サービスにおけるキャリアアドバイザーのシフトスケジューリング
recruitengineers
PRO
1
140
チームで進めるAI駆動アジャイル×ウォーターフォール
kumaiu
0
150
爆速でマルチプロダクトを立ち上げる時 事業・CTO目線で大事にしたい事
miyatakoji
0
100
白金鉱業Meetup_Vol.24_「AIエージェントは分けるほど良い」は本当か? / Is it true that “the more you divide AI agents, the better”?
brainpadpr
1
310
RAG を使わないという選択肢
tatsutaka
1
200
AIソロプレナー時代に2ヶ月で20人増員した事業創造会社の開発組織の話
miyatakoji
0
610
On-behalf-of Token exchange with AgentCore Identity
hironobuiga
2
150
「エンジニア進化論」2028年の開発完全自動化、エンジニアはどう進化するか
cyberagentdevelopers
PRO
6
4.6k
AIの性能が向上しても未解決な組織の重大問題は何か?/An Unsolved Organizational Problem in the Age of AI
moriyuya
4
620
新しいVibe Codingと”自走”について
watany
6
300
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
6.9k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
570
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
390
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
230
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
370
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
770
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
940
Git: the NoSQL Database
bkeepers
PRO
432
67k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Practical Orchestrator
shlominoach
191
11k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
160
Transcript
Hash Tree 2015/11/10 0x64 Tales #02 Data Structure Livesense Inc.
HORINOUCHI Masato
Hash Tree ͬͯͳʹ?
֓ཁ ҉߸ཧ͓ΑͼܭࢉػՊֶʹ͓͍ͯɺϋογϡ(Hash tree, ϋο γϡπϦʔ)·ͨϚʔΫϧ(Merkle tree)ͱɺΑΓେ͖ͳσʔ λʢྫ͑ϑΝΠϧʣͷཁ݁ՌΛ֨ೲ͢ΔߏͷҰछͰ͋ ΓɺσʔλͷݕূΛߦ͏ࡍʹ༻͞ΕΔɻ — ϋογϡ
- Wikipedia
ཁ͢Δʹ… େ͖ͳσʔλΛෳσʔλϒϩοΫ ʹׂ͠ɺഁଛվ᜵ͷݕূॲཧʹ ར༻Ͱ͖Δɻ
ಈ࡞ݪཧ • ೋ • Ϧʔϑ • σʔλϒϩοΫͷϋογϡ • (෦)ϊʔυ •
ࢠϊʔυͷϋογϡΛ݁߹ͨ݁͠Ռͷϋογϡ
None
σϞ ݩσʔλੜ $ dd if=/dev/urandom of=sample bs=1M count=4 $ split
--bytes=1048576 --numeric=1 --suffix-length=1 sample L $ ls -l -rw-r--r-- 1 horinouchi horinouchi 1048576 Nov 10 18:37 L1 -rw-r--r-- 1 horinouchi horinouchi 1048576 Nov 10 18:37 L2 -rw-r--r-- 1 horinouchi horinouchi 1048576 Nov 10 18:37 L3 -rw-r--r-- 1 horinouchi horinouchi 1048576 Nov 10 18:37 L4 -rw-r--r-- 1 horinouchi horinouchi 4194304 Nov 10 18:34 sample σʔλݕূͳͲͰར༻͢ΔMerkle TreeͷϝϞ Λࢀߟʹ͠·ͨ͠ɻ
ख࡞ۀ $ openssl dgst -sha256 -binary L1 > H00 $
openssl dgst -sha256 -binary L2 > H01 $ openssl dgst -sha256 -binary L3 > H10 $ openssl dgst -sha256 -binary L4 > H11 $ cat H00 H01 | openssl dgst -sha256 -binary > H0 $ cat H10 H11 | openssl dgst -sha256 -binary > H1 $ cat H0 H1 | openssl dgst -sha256 -binary > TOP $ hexdump -C TOP
Ruby gem $ gem install treehash $ treehash sample •
Treehash • ͱ͍͑ɺ͜ͷ gem ͷதશ͘ೋͬͯͳ͍…ɻ
ZFS • Data integrity (σʔλશੑ) • σΟεΫΛॻ͖͑ͯϒϩοΫ୯ҐͰνΣοΫͰ͖Δ Αɻ • Copy-On-Write
• ϒϩοΫ୯ҐͰߋ৽ՕॴͷΈ write Ͱ͖ΔΑɻ
ଞͷ Hash Tree ͷར༻ • P2P • BitTorrent • Bitcoin
• ࢄVCS • Git
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠