Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Hash Tree
Search
HORINOUCHI Masato
November 10, 2015
Technology
0
75
Hash Tree
社内LT大会 0x64物語 #02 Data Structure 資料
HORINOUCHI Masato
November 10, 2015
Tweet
Share
More Decks by HORINOUCHI Masato
See All by HORINOUCHI Masato
balenaCloud
thermes
0
73
Church Numerals
thermes
0
46
CPS & CTO
thermes
0
250
FM synthesis
thermes
0
36
A440
thermes
0
61
Inside mml2wav.rb
thermes
0
86
Scheme Interpreter in Ruby
thermes
0
70
Clock / Timer
thermes
0
160
POSIX Threads
thermes
0
56
Other Decks in Technology
See All in Technology
生成AI時代におけるグローバル戦略思考
taka_aki
0
170
[JAWS-UG 横浜支部 #91]DevOps Agent vs CloudWatch Investigations -比較と実践-
sh_fk2
2
250
多様なデジタルアイデンティティを攻撃からどうやって守るのか / 20251212
ayokura
0
430
[デモです] NotebookLM で作ったスライドの例
kongmingstrap
0
140
Snowflakeでデータ基盤を もう一度作り直すなら / rebuilding-data-platform-with-snowflake
pei0804
4
1.4k
意外とあった SQL Server 関連アップデート + Database Savings Plans
stknohg
PRO
0
310
Power of Kiro : あなたの㌔はパワステ搭載ですか?
r3_yamauchi
PRO
0
110
学習データって増やせばいいんですか?
ftakahashi
2
320
会社紹介資料 / Sansan Company Profile
sansan33
PRO
11
390k
非CUDAの悲哀 〜Claude Code と挑んだ image to 3D “Hunyuan3D”を EVO-X2(Ryzen AI Max+395)で動作させるチャレンジ〜
hawkymisc
2
170
「Managed Instances」と「durable functions」で広がるAWS Lambdaのユースケース
lamaglama39
0
310
LLM-Readyなデータ基盤を高速に構築するためのアジャイルデータモデリングの実例
kashira
0
240
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Thoughts on Productivity
jonyablonski
73
5k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Context Engineering - Making Every Token Count
addyosmani
9
510
Facilitating Awesome Meetings
lara
57
6.7k
Building Applications with DynamoDB
mza
96
6.8k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
70k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
GitHub's CSS Performance
jonrohan
1032
470k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
710
Raft: Consensus for Rubyists
vanstee
141
7.2k
Agile that works and the tools we love
rasmusluckow
331
21k
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
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠