Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/TheAlgorithms/JavaScript
/ pad
Function
pad
Conversions/BinaryToHex.js:1–4 ·
view source on GitHub ↗
(num, padlen)
Source
from the content-addressed store, hash-verified
1
const
pad = (num, padlen) => {
2
const
pad =
new
Array(1 + padlen).join(0)
3
return
(pad + num).slice(-pad.length)
4
}
5
6
const
hexLookup = (bin) => {
7
let
binary = bin
Callers
1
hexLookup
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected