Comments (2)
I'll make some docs. However, just the bcrypt hashes have a fixed size: 80 - full base64 encoded, 60 - crypt scheme hash, 55 - my short hash implementation expandable to the crypt scheme. The SHA2 schemes have a variable length given by the rounds parameter. Unless you won't go over an order of ten (such as from 5000 to 10000 - an extra char) everything will be OK from the DB point of view. Or you may leave some room, just to be on the safe side when doing adaptive hashing.
Later Edit: the short hash representation of SHA2 uses base36 encoding for the rounds parameter, therefore the hash length increases slower than using the base10 representation.
from passwordhash2.
Yea I knew the sha algos had no fixed length. I did have a quick look at the implementation and saw
<?php
$length = strlen((string) $cost) - 4;
$length = self::$map[$algo]['min_length'] + $length;
With $cost being 999999999 at max, I figured the max length would be min_length + 5.
So 75+5=80 for sha256 and 118+5=123 for sha512. Guess I should have looked a bit closer to take the base64 encoding into account.
Thanks for writing up the docs.
from passwordhash2.
Related Issues (2)
- Expose algo() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from passwordhash2.