Permalink
Cannot retrieve contributors at this time
21 lines (21 sloc)
591 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/@azure/core-util/dist-esm/src/hex.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) Microsoft Corporation. | |
// Licensed under the MIT license. | |
/** | |
* Converts an ArrayBuffer to a hexadecimal string. | |
* @param buffer - Raw binary data. | |
* @internal | |
*/ | |
export function bufferToHex(buffer) { | |
const bytes = new Uint8Array(buffer); | |
return Array.prototype.map.call(bytes, byteToHex).join(""); | |
} | |
/** | |
* Converts a byte to a hexadecimal string. | |
* @param byte - An integer representation of a byte. | |
* @internal | |
*/ | |
function byteToHex(byte) { | |
const hex = byte.toString(16); | |
return hex.length === 2 ? hex : `0${hex}`; | |
} | |
//# sourceMappingURL=hex.js.map |