Skip to main content

Module utils

Module utils 

Source
Expand description

Shared utilities for the S3 service.

Provides ID generation, timestamp helpers, range-header parsing, conditional-request matching, continuation-token encoding, and XML escaping functions.

Functionsยง

decode_continuation_token
Decode a base64 continuation token back to an object key.
encode_continuation_token
Encode an object key as a base64 continuation token.
generate_request_id
Generate a unique request ID (UUID v4 without dashes).
generate_upload_id
Generate a random upload ID for multipart uploads.
generate_version_id
Generate a random version ID suitable for S3 versioned objects.
is_valid_if_match
Check whether the given ETag satisfies an If-Match condition.
is_valid_if_none_match
Check whether the given ETag satisfies an If-None-Match condition.
parse_copy_source
Parse the x-amz-copy-source header value into bucket, key, and optional version ID components.
parse_range_header
Parse an HTTP Range header value and return the inclusive byte range.
timestamp_millis
Return the current UTC time as milliseconds since the Unix epoch.
timestamp_rfc3339
Return the current UTC time formatted as an RFC 3339 string.
xml_escape
Escape a string for safe inclusion in XML content.