14,954
edits
| Line 93: | Line 93: | ||
SHA-256 ([https://zh.wikipedia.org/zh-tw/SHA-2 SHA-2]) | SHA-256 ([https://zh.wikipedia.org/zh-tw/SHA-2 SHA-2]) | ||
* Data type: CHAR(64) | * Data type: | ||
** CHAR(64) - The hexadecimal representation of a SHA-256 hash consists of 64 characters. This is because SHA-256 is a 256-bit hash function, resulting in 256 binary bits. Since each hexadecimal character corresponds to 4 binary bits, 64 hexadecimal characters are needed to represent a complete SHA-256 hash. | |||
** BINARY(32) - If stored in binary format, a SHA-256 hash has a length of 32 bytes. Each byte contains 8 binary bits. Therefore, the BINARY(32) data type is used to store the binary representation of a SHA-256 hash. | |||
* Framework: MySQL [https://dev.mysql.com/doc/refman/8.0/en/sha256-pluggable-authentication.html MySQL :: MySQL 8.0 Reference Manual :: 8.4.1.3 SHA-256 Pluggable Authentication], [https://www.php.net/manual/zh/function.hash.php PHP: hash - Manual] | * Framework: MySQL [https://dev.mysql.com/doc/refman/8.0/en/sha256-pluggable-authentication.html MySQL :: MySQL 8.0 Reference Manual :: 8.4.1.3 SHA-256 Pluggable Authentication], [https://www.php.net/manual/zh/function.hash.php PHP: hash - Manual] | ||