OxL Reference

fn pbkdf2

PBKDF2-HMAC-SHA256 key derivation.

Example:

oxl✓ checked in CI
use std.crypto { pbkdf2 }
use std.ser { bytesOf }

fn main() io {
  print("{pbkdf2(bytesOf(&"pw"), bytesOf(&"salt"), 1000, 32)!.len()}")
}
Output
32
pub(api) fn pbkdf2(password: bytes, salt: bytes, iterations: i64, length: i64) -> bytes | CryptoError

Since. 1.0.0-beta

Parameters

NameType
passwordbytes
saltbytes
iterationsi64
lengthi64

Returns

bytes

Errors

Effects

none declared (pure unless the body says otherwise)

Defined in: std/crypto/crypto.oxl:745

See also