开发者
编程技术、框架工具、最佳实践
共 7229 篇 · 第 221/362 页
F* file system – file search that reads SSD directly bypassing OS kernel
Chile Eliminates Leprosy
Nintendo Wii U games running from a 1980's Bernoulli disk [video]
Ask for no, don't ask for yes (2022)
Read More Fiction
Graphene experts are trying to close reproducibility gap in 2D materials
I make good money. Why do I still feel like this?
bcrypt and Laravel: 72 Bytes, Not 72 Characters
I expected bcrypt to silently drop characters past 72. I did not expect it to bake in half an emoji. That's what happens with a specific password combination I tested. The original password still works. But strip the emoji (a password manager, a different keyboard, a Unicode normalizer) and you're locked out. Your Laravel validator passed it as valid the whole time. The 72-Byte Rule bcrypt has a hard input limit of 72 bytes. Not characters - bytes. When you call password_hash($password, PASSWORD_BCRYPT) , PHP silently truncates anything past byte 72. Most developers know this in theory. But for ASCII-only apps, it never bites. 72 ASCII characters is already a very long password, and the silent clip is harmless in practice. The trouble starts with multi-byte scripts. How Many Characters Fit? Character set Bytes per char Effective bcrypt limit ASCII 1 72 chars Cyrillic 2 36 chars CJK (Chinese, Japanese, Korean, common block) 3 24 chars Emoji 4 18 chars Past the byte limit, a longer password adds no security at all. A 200-character Cyrillic password hashes identically to its own first 36 characters. Byte 73 and beyond simply do not exist from bcrypt's point of view. So "longer always produces a stronger bcrypt hash" is not true. A Cyrillic user with a 37-character password gets silently truncated at char 36. The hash is still consistent. The user logs in fine, but any variation past character 36 doesn't matter to bcrypt. Annoying from a security standpoint, but it does not break login. The Split-Byte Trap The 72-byte limit cuts at a byte boundary, not a character boundary. If a multi-byte character falls on that cut, bcrypt bakes in an incomplete UTF-8 sequence. // 35 Cyrillic chars = 70 bytes, emoji = 4 bytes, total = 74 bytes $password = str_repeat ( 'А' , 35 ) . '🔑' ; $hash = password_hash ( $password , PASSWORD_BCRYPT ); password_verify ( $password , $hash ); // ? password_verify ( str_repeat ( 'А' , 35 ), $hash ); // ? password_verify ( str_repeat ( 'А' , 36 ), $h
A practical guide to describing authentication and authorization in OpenAPI.
Hope it helps anyone documenting or reviewing API specs. submitted by /u/AntonOkolelov [link] [留言]
Hunting Million-Digit Primes from My Loft
Cold Court’s debut EP is an infectious, glitchy genre mashup
Cold Court is a brother-sister duo from Philly that seems to love nothing more than shoving all of their influences together in a messy soup that at least superficially resembles the hyperpop you've come to expect from acts like 100 Gecs. But, where songs like "Dumbest Girl Alive" goofily wink at pop punk and emo, […]
Wildcard (YC W25) is hiring an applied ML engineer
Article URL: https://www.ycombinator.com/companies/wildcard/jobs/SEmo4di-founding-applied-ml-engineer Comments URL: https://news.ycombinator.com/item?id=48620504 Points: 0 # Comments: 0
Burnout Is Real in the OSS World, Says John-David Dalton, Creator of Lodash
The Disappearance of Japan's Animators
The Minimum Viable Unit of Saleable Software
Peter H. Diamandis, MD on X: "The Next 5 Years: A Supersonic Tsunami" / X
The early hiring funnel is now breaking on both ends
Prefer duplication over the wrong abstraction (2016)
👾 Server Access Logs with GoAccess
Part 1: Self-hosting on Jetson Orin Nano 👽 Jetson Orin Nano Web Server Follow-up...