Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Hashids and Perceptual hashes
Search
Jens Segers
April 29, 2015
Technology
150
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Hashids and Perceptual hashes
PHP Ghent presentation
Jens Segers
April 29, 2015
More Decks by Jens Segers
See All by Jens Segers
Building a digital ID card for authentication
jenssegers
0
86
JSON Web Tokens in a microservice architecture (PHPBenelux)
jenssegers
0
570
JSON Web Tokens - PHP Antwerp
jenssegers
0
230
Testing API's with Behat
jenssegers
0
390
Apps for Ghent - Realo
jenssegers
0
340
An introduction to automated development environment and Laravel Homestead
jenssegers
0
260
Git 101
jenssegers
1
200
Other Decks in Technology
See All in Technology
山手線を徒歩で一周してわかった、 位置情報アプリは「足」が最強のデバッガー
hinakko
0
180
技術的負債から考える、AI時代のエンジニアリング投資 — ビズリーチの技術的負債と向き合った経験から、変更し続けられるソフトウェアを考える/ technical-debt-con2026
visional_engineering_and_design
4
3.4k
新機種発売前に見直そう!端末移行で再ログインが要るアプリ・要らないアプリは何が違うのか 〜シームレスに再開できる設計と実装〜
zozotech
PRO
0
220
現場で役立つ技術負債の効果的な返済方法
masuda220
PRO
9
4.9k
Deployment の 先にある AI Agent 基盤 - kagent vNext、Agent Substrate、Hermes から読み解く Agent Runtime の現在地 / k8s-matsuri-2-ai-agent-platform-amsy810
masayaaoyama
4
690
リアーキテクチャ後の障害ゼロを目指したShadow Testingの取り組み
nihonbuson
PRO
1
160
LLMに渡さなかった仕事
nanaism
0
1.3k
EventBridge に「合流」はない ― サーバーレスのワークフローを育てるということ / No Join in EventBridge
yusukeshimizu
2
400
白金鉱業Meetup Vol.25 アウトカムが二値のデータに対するCausal Impact
brainpadpr
0
270
Minecraft JavaのMODをSwiftで作る
1mash0
0
190
AIによるクリエイティブ生成を行う上での試行錯誤
plaidtech
PRO
0
160
AIは推し活である。
kurazuuuuuu
1
920
Featured
See All Featured
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
580
Odyssey Design
rkendrick25
PRO
2
810
Discover your Explorer Soul
emna__ayadi
2
1.3k
What does AI have to do with Human Rights?
axbom
PRO
1
2.4k
A designer walks into a library…
pauljervisheath
211
25k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Visualization
eitanlees
152
17k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
410
YesSQL, Process and Tooling at Scale
rocio
174
15k
Designing for Timeless Needs
cassininazir
1
480
Marketing to machines
jonoalderson
1
5.8k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Transcript
None
@jenssegers Jens Segers
Hashids hashids/hashids
youtube.com/watch?v=dQw4w9WgXcQ
Why id obfuscation? Hiding application internals Reduces chance for URL
guessing Hide number of users, articles, … More difficult for scrapers
Encoding ids $hashids = new Hashids\Hashids('salt'); $encodedId = $hashids->encode(123); $hashids
= new Hashids\Hashids('salt'); $decodedId = $hashids->decode('Mj3')[0]; Decoding ids
Perceptual hashes jenssegers/imagehash
Removing thumbnails and duplicate images
#b40b2980dcbd08a #c1e9ee950f0e56cc Different from cryptographic hashing
Perceptual fingerprint No avalanche effect Comparing hashes Similar images =
similar hashes
Hamming Distance Number of different individual bits gmp_hamdist(0b10100110001, 0b10100110101) =
1
None
None
None
None
0000000000000010000000110000011100001111000111110110111111111111
0000000000000010000000110000011100001111000111110110111111111111 1011000110001000111110000000010100100111110100000100010100001010
Calculating the hash Using a different implementation: use Jenssegers\ImageHash\ImageHash; $hasher
= new ImageHash; $hash = $hasher->hash('path/to/image.jpg'); use Jenssegers\ImageHash\Implementation\AverageHash; $hasher = new ImageHash(new AverageHash); $hash = $hasher->hash('path/to/image.jpg');
Comparing hashes Or use your database: $d = $hasher->compare('image1.jpg', 'image2.jpg');
$d = $hasher->distance($hash1, $hash2); SELECT BIT_COUNT(hash ^ :hash) as hamming_distance FROM images HAVING hamming_distance < 5
@jenssegers Jens Segers