MCPcopy 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

1const pad = (num, padlen) => {
2 const pad = new Array(1 + padlen).join(0)
3 return (pad + num).slice(-pad.length)
4}
5
6const hexLookup = (bin) => {
7 let binary = bin

Callers 1

hexLookupFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected