MCPcopy
hub / github.com/OneUptime/oneuptime / convertBase64ToHex

Method convertBase64ToHex

Common/Types/Text.ts:2–13  ·  view source on GitHub ↗
(textInBase64: string)

Source from the content-addressed store, hash-verified

1export default class Text {
2 public static convertBase64ToHex(textInBase64: string): string {
3 if (!textInBase64) {
4 return textInBase64;
5 }
6
7 if (!this.isBase64(textInBase64)) {
8 return textInBase64;
9 }
10
11 const hex: string = Buffer.from(textInBase64, "base64").toString("hex");
12 return hex;
13 }
14
15 /**
16 * Matches an OTLP id already in hex form: 16 chars (8-byte span id)

Callers 2

convertOtlpIdToHexMethod · 0.80
Text.test.tsFile · 0.80

Calls 3

isBase64Method · 0.95
toStringMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected