メインコンテンツまでスキップ

11. Base64のISO C99実装

RFC 4648 には, algorithm を説明するための ISO C99 Base64 implementation が含まれる. この code は例であり, 唯一の正しい implementation ではない.

この例は alphabet lookup, padding generation, decoder validation を示す. 実装者は自分の環境に合わせて boundary check, allocation behavior, error handling, alphabet 外文字の処理を確認する必要がある.

security-sensitive な software では, malformed padding, invalid character, non-zero padding bit を default で黙って受け入れるべきではない.