SHA-1
An older hash function producing a 160-bit value, now considered broken for security because collisions can be created on purpose.
In more detail
It is written as 40 hexadecimal characters and is still how Git names objects by default. Standards bodies recommend SHA-256 for new uses, and it must not be used for signatures or certificates.
Examples
Git names objects with a hardened SHA-1 by default; git init --object-format=sha256 creates a SHA-256 repository instead.The WebSocket handshake computes Sec-WebSocket-Accept with SHA-1; that is a protocol check, not a security guarantee.Related terms
- object ID — The hash that names a Git object, such as a commit, and that you type to refer to it.
- SHA-256 — A widely used hash function that turns any data into a 256-bit fingerprint, shown as 64 hexadecimal characters.
- hash — A short fixed-length fingerprint calculated from data, which changes completely if even one byte of the data changes.
- hexadecimal — A way of writing numbers with sixteen digits, 0 to 9 and then a to f, so each character stands for four bits.
Taught in
- Workflows, Jobs, Steps, and Actions — Continuous Integration & Continuous Delivery Pipelines
- Cryptographic Hashing: SHA-256, SHA-3 & Passwords — Cybersecurity Fundamentals, GRC & Cryptography
- Why Version Control, And Why Git Won — Advanced Git Internals & Distributed Workflows
- What A Commit Really Is — Advanced Git Internals & Distributed Workflows
- Cryptographic Primitives: node:crypto & Ciphers — Node.js Internals & Backend Services
- Native WebSockets: Bidirectional Real-Time Streams — Node.js Internals & Backend Services