From 6261c1373168b265047db5704d9d0fd5f2e458f2 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 26 Apr 2023 13:57:08 -0700 Subject: update codebase to use `@memset` and `@memcpy` --- lib/std/crypto/bcrypt.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/std/crypto/bcrypt.zig') diff --git a/lib/std/crypto/bcrypt.zig b/lib/std/crypto/bcrypt.zig index 2191ab0d9e..dda5f5e377 100644 --- a/lib/std/crypto/bcrypt.zig +++ b/lib/std/crypto/bcrypt.zig @@ -416,8 +416,8 @@ pub fn bcrypt( ) [dk_length]u8 { var state = State{}; var password_buf: [73]u8 = undefined; - const trimmed_len = math.min(password.len, password_buf.len - 1); - mem.copy(u8, password_buf[0..], password[0..trimmed_len]); + const trimmed_len = @min(password.len, password_buf.len - 1); + @memcpy(password_buf[0..trimmed_len], password[0..trimmed_len]); password_buf[trimmed_len] = 0; var passwordZ = password_buf[0 .. trimmed_len + 1]; state.expand(salt[0..], passwordZ); @@ -626,7 +626,7 @@ const CryptFormatHasher = struct { crypto.random.bytes(&salt); const hash = crypt_format.strHashInternal(password, salt, params); - mem.copy(u8, buf, &hash); + @memcpy(buf[0..hash.len], &hash); return buf[0..pwhash_str_length]; } -- cgit v1.2.3