Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • c54bb69
  • /
  • include
  • /
  • internal
  • /
  • to_hex.h
Raw File
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:e37e9f0b4390e819fb6feabd5d585d786b3652fa
directory badge Iframe embedding
swh:1:dir:0655ed811c784662fe9af39719b01909dbb9d33d
to_hex.h
/*
 * Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
 *
 * Licensed under the Apache License 2.0 (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
 */

#ifndef OSSL_INTERNAL_TO_HEX_H
# define OSSL_INTERNAL_TO_HEX_H
# pragma once

static ossl_inline size_t to_hex(char *buf, uint8_t n, const char hexdig[17])
{
    *buf++ = hexdig[(n >> 4) & 0xf];
    *buf = hexdig[n & 0xf];
    return 2;
}

static ossl_inline size_t ossl_to_lowerhex(char *buf, uint8_t n)
{
    static const char hexdig[] = "0123456789abcdef";

    return to_hex(buf, n, hexdig);
}
#endif

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top