Skip to main content

legacy_password_hash

Function legacy_password_hash 

Source
pub fn legacy_password_hash(password: &str) -> u16
Expand description

Legacy password hash used by Excel for workbook protection.

This is NOT cryptographically secure – it is the same hash algorithm that Excel uses for the workbookPassword attribute. The result is a 16-bit value that is typically stored as a 4-character uppercase hex string.

Passwords are processed as UTF-8 bytes to preserve the existing public API behavior. This matches Office-compatible ASCII passwords; non-ASCII input follows the crate’s established byte-oriented policy.