Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/xpcom/io/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  Hex.h

  Sprache: C
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


#ifndef mozilla_Hex_h_
#define mozilla_Hex_h_

#include <cstdint>

#include "mozilla/Span.h"
#include "nscore.h"
#include "nsStringFwd.h"
#include "nsTArrayForwardDeclare.h"

namespace mozilla {

// Replaces |aOut| with the hexadecimal encoding of |aBytes| (two characters per
// byte; e.g. {0xAB, 0x0C} becomes "ab0c"). The output is lowercase unless
// |aUpperCase| is true. This is the binary->text analogue of Base64Encode;
// prefer it over hand-rolling yet another hex loop.
void HexEncode(Span<const uint8_t> aBytes, nsACString& aOut,
               bool aUpperCase = false);

// Decodes the hexadecimal text |aHex| into the raw bytes |aOut|, accepting
// upper- and lowercase digits; this is the inverse of HexEncode. Returns
// NS_ERROR_INVALID_ARG (and leaves |aOut| empty) if |aHex| has an odd length or
// contains a character outside [0-9a-fA-F].
nsresult HexDecode(const nsACString& aHex, nsTArray<uint8_t>& aOut);

}  // namespace mozilla

#endif  // mozilla_Hex_h_

Messung V0.5 in Prozent
C=88 H=97 G=92

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.