Adem Derinel | 620520b4 | 2024-11-04 15:45:44 | [diff] [blame] | 1 | // Copyright 2024 The Chromium Authors |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "content/browser/webauth/common_utils.h" |
| 6 | |
| 7 | #include <string> |
| 8 | |
| 9 | #include "base/base64url.h" |
| 10 | #include "base/containers/span.h" |
| 11 | |
| 12 | namespace content { |
| 13 | |
Slobodan Pejic | 435c11ef | 2024-12-09 18:28:24 | [diff] [blame] | 14 | std::string Base64UrlEncodeOmitPadding( |
Adem Derinel | 620520b4 | 2024-11-04 15:45:44 | [diff] [blame] | 15 | const base::span<const uint8_t> challenge) { |
| 16 | std::string ret; |
| 17 | base::Base64UrlEncode(challenge, base::Base64UrlEncodePolicy::OMIT_PADDING, |
| 18 | &ret); |
| 19 | return ret; |
| 20 | } |
| 21 | |
| 22 | } // namespace content |