bcrypt
go get -u golang.org/x/crypto/bcryptconst (
MinCost int = 4 // the minimum allowable cost as passed in to GenerateFromPassword
MaxCost int = 31 // the maximum allowable cost as passed in to GenerateFromPassword
DefaultCost int = 10 // the cost that will actually be set if a cost below MinCost is passed into GenerateFromPassword
)// 固定总长度:60 个字符
$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy
↓ ↓ ↓ ↓
│ │ │ └── 哈希结果 (31字符)
│ │ └───────────────────────────── 盐值 (22字符)
│ └───────────────────────────────── 成本因子=10
└──────────────────────────────────── 算法版本=2a
最后更新于