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
160
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
93
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
400
Apps for Ghent - Realo
jenssegers
0
340
An introduction to automated development environment and Laravel Homestead
jenssegers
0
260
Git 101
jenssegers
1
220
Other Decks in Technology
See All in Technology
Kiro 入門 (1 つのエージェントを、どの画面からでも) | 目指せ Kiro マスター 01
inariku
PRO
6
1.4k
AI Agent 時代のデータ基盤: ClickHouse で実現する 超高速分析とコスト削減の両立
jozono
0
220
SREのためのFinOps入門
muziyoshiz
2
840
基本から分かる!AWSセキュリティ運用の考え方と任せ方
cmusudakeisuke
1
480
公共システムAdventCalendar2026
toru_kubota
0
290
In-Context Learning再入門。ICLの勾配降下的解釈の研究動向を追ってみる。
dai08srhg
1
780
AWS基盤改善を支える 私たちの理念と行動指針
kentosuzuki
0
140
Cloudflareの向き先
chimame
1
160
超⼩型・多⾔語検索モデル Bekko Embedding
hotchpotch
1
140
HQ駆動開発で最高のAI-Contextを作ろう
sansantech
PRO
1
120
AX時代の自治体支援リソース再配分と役割分担の再構成:戦略とロードマップ(概要)
sishi2026
0
210
PostgreSQL オプティマイザ統計の秘密
nori_shinoda
1
440
Featured
See All Featured
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
560
GitHub's CSS Performance
jonrohan
1033
470k
Un-Boring Meetings
codingconduct
0
490
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.9k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Leo the Paperboy
mayatellez
10
2.4k
Building an army of robots
kneath
307
47k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
320
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Testing 201, or: Great Expectations
jmmastey
46
8.4k
Designing for Performance
lara
612
70k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
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