Skip to content

Commit

Permalink
Add note of compat namespace to the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed Jan 8, 2025
1 parent f8c811f commit 25c1f0b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
5 changes: 5 additions & 0 deletions doc/crypt/api_reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ https://www.boost.org/LICENSE_1_0.txt
= API Reference
:idprefix: api_ref_

== Namespace

- `compat` Any time you see the namespace `compat` it is an alias to either `std::` or `cuda::std::` depending on the compiler being used

== Types

- None
Expand Down Expand Up @@ -104,6 +108,7 @@ https://www.boost.org/LICENSE_1_0.txt
== Concepts

- <<file_system_path, `file_system_path`>>
- <<writeable_output_range, `writeable_output_range`>>

== Macros

Expand Down
14 changes: 6 additions & 8 deletions doc/crypt/sha1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ namespace boost::crypt {
class sha1_hasher
{
public:
uisng return_type = std::array<std::byte, 20>;
uisng return_type = compat::array<compat::byte, 20>;
// Initialize the hasher
constexpr void init() noexcept;
// Process bytes piecewise
constexpr state process_bytes(std::span<const std::byte> data) noexcept;
constexpr state process_bytes(compat::span<const compat::byte> data) noexcept;
template <std::ranges::sized_range Range>
template <compat::ranges::sized_range Range>
constexpr state process_bytes(Range&& data) noexcept;
// Finalize the calculation of the hash
Expand All @@ -42,9 +42,8 @@ public:
// Get the digest
[[nodiscard]] constexpr return_type get_digest() noexcept;
template <typename Range>
template <concepts::writable_output_range Range>
BOOST_CRYPT_GPU_ENABLED state get_digest(Range&& data) noexcept
requires std::output_range<Range, std::range_value_t<Range>> && std::sized_range<Range> && std::is_trivially_copyable_v<std::range_value_t<Range>>;
};
} // namespace boost::crypt
Expand All @@ -56,9 +55,9 @@ public:
----
namespace boost::crypt {
BOOST_CRYPT_GPU_ENABLED constexpr auto sha1(std::span<const std::byte> data) noexcept -> sha1_hasher::return_type;
BOOST_CRYPT_GPU_ENABLED constexpr auto sha1(compat::span<const compat::byte> data) noexcept -> sha1_hasher::return_type;
template <std::ranges::sized_range SizedRange>
template <compat::ranges::sized_range SizedRange>
BOOST_CRYPT_GPU_ENABLED constexpr auto sha1(SizedRange&& data) noexcept -> sha1_hasher::return_type;
} // namespace boost::crypt
Expand All @@ -73,7 +72,6 @@ We also have the ability to scan files and return the sha1 value:
namespace boost::crypt {
template <concepts::file_system_path T>
requires std::is_convertible_v<T, std::string> || std::is_convertible_v<T, std::string_view>
inline auto sha1_file(const T& filepath) -> sha1_hasher::return_type;
} // namespace boost::crypt
Expand Down
14 changes: 6 additions & 8 deletions doc/crypt/sha224.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ namespace boost::crypt
class sha224_hasher
{
public:
uisng return_type = std::array<std::byte, 28>;
uisng return_type = compat::array<compat::byte, 28>;
// Initialize the hasher
constexpr void init() noexcept;
// Process bytes piecewise
constexpr state process_bytes(std::span<const std::byte> data) noexcept;
constexpr state process_bytes(compat::span<const compat::byte> data) noexcept;
template <std::ranges::sized_range Range>
template <compat::ranges::sized_range Range>
constexpr state process_bytes(Range&& data) noexcept;
// Finalize the calculation of the hash
Expand All @@ -42,9 +42,8 @@ public:
// Get the digest
[[nodiscard]] constexpr return_type get_digest() noexcept;
template <typename Range>
template <concepts::writable_output_range Range>
BOOST_CRYPT_GPU_ENABLED state get_digest(Range&& data) noexcept
requires std::output_range<Range, std::range_value_t<Range>> && std::sized_range<Range> && std::is_trivially_copyable_v<std::range_value_t<Range>>;
};
} // namespace boost::crypt
Expand All @@ -56,9 +55,9 @@ public:
----
namespace boost::crypt {
BOOST_CRYPT_GPU_ENABLED constexpr auto sha224(std::span<const std::byte> data) noexcept -> sha224_hasher::return_type;
BOOST_CRYPT_GPU_ENABLED constexpr auto sha224(compat::span<const compat::byte> data) noexcept -> sha224_hasher::return_type;
template <std::ranges::sized_range SizedRange>
template <compat::ranges::sized_range SizedRange>
BOOST_CRYPT_GPU_ENABLED constexpr auto sha224(SizedRange&& data) noexcept -> sha224_hasher::return_type;
} // namespace boost::crypt
Expand All @@ -73,7 +72,6 @@ We also have the ability to scan files and return the sha224 value:
namespace boost::crypt {
template <concepts::file_system_path T>
requires std::is_convertible_v<T, std::string> || std::is_convertible_v<T, std::string_view>
inline auto sha224_file(const T& filepath) -> sha224_hasher::return_type;
} // namespace boost::crypt
Expand Down

0 comments on commit 25c1f0b

Please sign in to comment.