MCPcopy Create free account
hub / github.com/ampproject/amphtml / base64UrlEncodeFromBytes

Function base64UrlEncodeFromBytes

third_party/subscriptions-project/swg.js:3228–3231  ·  view source on GitHub ↗

* Converts a bytes array into base64url encoded string. * base64url is defined in RFC 4648. It is sometimes referred to as "web safe". * @param {!Uint8Array} bytes * @return {string}

(bytes)

Source from the content-addressed store, hash-verified

3226 * @return {string}
3227 */
3228function base64UrlEncodeFromBytes(bytes) {
3229 const str = bytesToString(bytes);
3230 return btoa(str).replace(/[+/=]/g, (ch) => base64UrlEncodeSubs[ch]);
3231}
3232
3233/**
3234 * Copyright 2018 The Subscribe with Google Authors. All Rights Reserved.

Callers 2

fetch_Method · 0.70

Calls 2

bytesToStringFunction · 0.70
replaceMethod · 0.45

Tested by

no test coverage detected