MCPcopy Create free account
hub / github.com/NativeScript/android / canonicalize_password

Function canonicalize_password

test-app/runtime/src/main/cpp/ada/ada.cpp:16114–16130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16112}
16113
16114tl::expected<std::string, errors> canonicalize_password(
16115 std::string_view input) {
16116 // If value is the empty string, return value.
16117 if (input.empty()) [[unlikely]] {
16118 return "";
16119 }
16120 // Let dummyURL be a new URL record.
16121 // Set the password given dummyURL and value.
16122 auto url = ada::parse<url_aggregator>("fake://dummy.test", nullptr);
16123
16124 ADA_ASSERT_TRUE(url.has_value());
16125 if (!url->set_password(input)) {
16126 return tl::unexpected(errors::type_error);
16127 }
16128 // Return dummyURL's password.
16129 return std::string(url->get_password());
16130}
16131
16132tl::expected<std::string, errors> canonicalize_hostname(
16133 std::string_view input) {

Callers 1

process_passwordMethod · 0.85

Calls 5

unexpectedClass · 0.85
set_passwordMethod · 0.80
get_passwordMethod · 0.60
emptyMethod · 0.45
has_valueMethod · 0.45

Tested by

no test coverage detected