Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/internal/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,11 @@ export function sanitizeETag(etag = ''): string {
}

export function toMd5(payload: Binary): string {
// use string from browser and buffer from nodejs
// browser support is tested only against minio server
return crypto.createHash('md5').update(Buffer.from(payload)).digest().toString('base64')
// MD5 is intentionally used here for the Content-MD5 header, which provides
// end-to-end payload integrity verification for S3 operations (RFC 1864).
// It is NOT used for cryptographic security or authentication.
// nosemgrep: use-of-md5
return crypto.createHash('md5').update(Buffer.from(payload)).digest().toString('base64') // nosec
}

export function toSha256(payload: Binary): string {
Expand Down
Loading