Sha256: 16fe7b586acdc6b82f69b9c59d2cbc4474f25b472637e4bf9ccacbbc35eaeb84

Contents?: true

Size: 1.32 KB

Versions: 10

Compression:

Stored size: 1.32 KB

Contents

/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
 *     Copyright 2017 Couchbase, Inc.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */
#pragma once

#include <cstdint>
#include <string_view>

namespace couchbase::core
{
/**
 * Get the value for a string of hex characters
 *
 * @param buffer the input buffer
 * @return the value of the string
 * @throws std::invalid_argument for an invalid character in the string
 *         std::overflow_error if the input string won't fit in std::uint64_t
 */
std::uint64_t
from_hex(std::string_view buffer);

std::string
to_hex(std::uint8_t val);

std::string
to_hex(std::uint16_t val);

std::string
to_hex(std::uint32_t val);

std::string
to_hex(std::uint64_t val);

std::string
to_hex(std::string_view buffer);

} // namespace couchbase::core

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
couchbase-3.5.3 ext/couchbase/core/platform/string_hex.h
couchbase-3.5.2 ext/couchbase/core/platform/string_hex.h
couchbase-3.5.1 ext/couchbase/core/platform/string_hex.h
couchbase-3.5.0 ext/couchbase/core/platform/string_hex.h
couchbase-3.4.5 ext/couchbase/core/platform/string_hex.h
couchbase-3.4.4 ext/couchbase/core/platform/string_hex.h
couchbase-3.4.3 ext/couchbase/core/platform/string_hex.h
couchbase-3.4.2 ext/couchbase/core/platform/string_hex.h
couchbase-3.4.1 ext/couchbase/core/platform/string_hex.h
couchbase-3.4.0 ext/couchbase/core/platform/string_hex.h