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
Hashids and Perceptual hashes
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Jens Segers
April 29, 2015
Technology
2
130
Hashids and Perceptual hashes
PHP Ghent presentation
Jens Segers
April 29, 2015
Tweet
Share
More Decks by Jens Segers
See All by Jens Segers
Building a digital ID card for authentication
jenssegers
0
56
JSON Web Tokens in a microservice architecture (PHPBenelux)
jenssegers
0
540
JSON Web Tokens - PHP Antwerp
jenssegers
0
220
Testing API's with Behat
jenssegers
0
370
Apps for Ghent - Realo
jenssegers
0
320
An introduction to automated development environment and Laravel Homestead
jenssegers
0
250
Git 101
jenssegers
1
190
Other Decks in Technology
See All in Technology
Master Dataグループ紹介資料
sansan33
PRO
1
4.4k
Agentic Software Modernization - Back to the Roots (Zürich Agentic Coding and Architectures, März 2026)
feststelltaste
0
120
Agentic Codingの実践とチームで導入するための工夫
lycorptech_jp
PRO
0
390
脱・コピペ!自分で調べて書くK8sマニフェスト
devops_vtj
0
110
AWS Bedrock Guardrails / 機密情報の入力・出力をブロックする — Blocking Sensitive Information Input/Output
kazuhitonakayama
2
190
【PyCon mini Shizuoka 2026】生成AI時代に画像処理やオーディオ処理のノードエディターを作る理由
kazuhitotakahashi
0
260
メタデータ同期に潜んでいた問題 〜 Cache Stampede 時の Cycle Wait を⾒つけた話
lycorptech_jp
PRO
0
140
大規模な組織におけるAI Agent活用の促進と課題
lycorptech_jp
PRO
5
7.7k
組織のSREを推進するためのPlatform EngineeringとEKS / Platform Engineering and EKS to drive SRE in your organization
chmikata
0
180
AIエンジニア Devin と歩む、自律型運用プロセスの構築
a2ito
0
620
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
14k
パネルディスカッション資料 (at Tableau Now! - 2026-02-26)
yoshitakaarakawa
0
1k
Featured
See All Featured
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
63
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
The agentic SEO stack - context over prompts
schlessera
0
680
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
130
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Documentation Writing (for coders)
carmenintech
77
5.3k
Being A Developer After 40
akosma
91
590k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
590
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
140
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
280
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