SHA-256 (Secure Hash Algorithm 256-bit) is a cryptographic hash function from the SHA-2 family designed by NIST. Produces 256-bit (32-byte) hash values from arbitrary input data.
| Property | Value |
|---|---|
| Category | Hash Functions |
| Sub-category | SHA-2 Family |
| Security status | π‘οΈ Secure |
| Complexity | Intermediate |
| Inventor | NIST |
| Year | 2001 |
| Origin | πΊπΈ United States |
| Source | algorithms/hash/sha256.js |
| Parameter | Supported values |
|---|---|
| Output sizes | 32 bytes (256 bits) |
Status: π‘οΈ Secure
No vulnerabilities are recorded for this implementation.
3 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.
Vector 1 β NIST Test Vector - Empty String
| Field | Value |
|---|---|
input |
(empty) |
expected |
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 |
Vector 2 β NIST Test Vector - βabcβ
| Field | Value |
|---|---|
input |
616263 |
expected |
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad |
Vector 3 β NIST Test Vector - Long String
| Field | Value |
|---|---|
input |
61626364626364656364656664656667 65666768666768696768696a68696a6b 696a6b6c6a6b6c6d6b6c6d6e6c6d6e6f 6d6e6f706e6f7071 |
expected |
248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1 |