DeterministicESPAsyncWebServer 1.2.0
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
sha1.h File Reference

Software SHA-1 implementation — no platform dependencies. More...

#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Macros

#define SHA1_DIGEST_LEN   20
 SHA-1 digest length in bytes.
 

Functions

void sha1 (const uint8_t *data, size_t len, uint8_t digest[SHA1_DIGEST_LEN])
 Compute a SHA-1 digest over an arbitrary byte buffer.
 

Detailed Description

Software SHA-1 implementation — no platform dependencies.

Used exclusively for the WebSocket opening handshake (RFC 6455 §4.2.2). Output is always a 20-byte digest.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file sha1.h.

Macro Definition Documentation

◆ SHA1_DIGEST_LEN

#define SHA1_DIGEST_LEN   20

SHA-1 digest length in bytes.

Definition at line 22 of file sha1.h.

Function Documentation

◆ sha1()

void sha1 ( const uint8_t *  data,
size_t  len,
uint8_t  digest[SHA1_DIGEST_LEN] 
)

Compute a SHA-1 digest over an arbitrary byte buffer.

Parameters
dataInput bytes.
lenNumber of input bytes.
digestOutput buffer; must be at least SHA1_DIGEST_LEN bytes.

Definition at line 24 of file sha1.cpp.