Documentation
¶
Overview ¶
Package operatorpw normalizes operator password file contents so the server and sablectl agree on what the password is, even when the file was written with a UTF-16 BOM (PowerShell's default) or other Windows-friendly encodings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Normalize ¶
Normalize returns the trimmed, decoded password from the raw bytes of a password file. It strips UTF-8/UTF-16 BOMs and decodes UTF-16 little- or big-endian content. Plain UTF-8 ASCII files are returned trimmed.
Order matters: BOMs are unambiguous and checked first. BOM-less UTF-16 is detected by null-byte heuristics before the utf8.Valid branch, because `s\x00e\x00...` is technically valid UTF-8 too — checking utf8.Valid first would mis-decode UTF-16 LE files written without a BOM.
Types ¶
This section is empty.