mirror of
https://github.com/ziglang/zig.git
synced 2024-11-26 23:22:44 +00:00
pbkdf2: use std.math.divCeil()
This commit is contained in:
parent
f609c4ddb3
commit
6d9b3e7b19
@ -79,7 +79,7 @@ pub fn pbkdf2(dk: []u8, password: []const u8, salt: []const u8, rounds: u32, com
|
|||||||
// block
|
// block
|
||||||
//
|
//
|
||||||
|
|
||||||
const blocks_count = (dk_len + h_len - 1) / h_len;
|
const blocks_count = @intCast(u32, std.math.divCeil(usize, dk_len, h_len) catch unreachable);
|
||||||
var r = dk_len % h_len;
|
var r = dk_len % h_len;
|
||||||
if (r == 0) {
|
if (r == 0) {
|
||||||
r = h_len;
|
r = h_len;
|
||||||
|
Loading…
Reference in New Issue
Block a user