(textInBase64: string)
| 1 | export 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) |
no test coverage detected