MCPcopy Create free account
hub / github.com/violentmonkey/violentmonkey / encodeSegment

Function encodeSegment

src/background/sync/s3.js:34–38  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

32
33// Per Sig V4: only unreserved chars (RFC 3986) are left unencoded in path segments.
34function encodeSegment(s) {
35 return encodeURIComponent(s).replace(/[!'()*]/g, (c) =>
36 '%' + c.charCodeAt(0).toString(16).toUpperCase(),
37 );
38}
39
40function toHex(buf) {
41 return Array.from(buf).map(b => b.toString(16).padStart(2, '0')).join('');

Callers 1

signS3RequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected