MCPcopy Create free account
hub / github.com/wevm/viem / bytesToBigInt

Function bytesToBigInt

src/utils/encoding/fromBytes.ts:116–123  ·  view source on GitHub ↗
(
  bytes: ByteArray,
  opts: BytesToBigIntOpts = {},
)

Source from the content-addressed store, hash-verified

114 * // 420n
115 */
116export function bytesToBigInt(
117 bytes: ByteArray,
118 opts: BytesToBigIntOpts = {},
119): bigint {
120 if (typeof opts.size !== 'undefined') assertSize(bytes, { size: opts.size })
121 const hex = bytesToHex(bytes)
122 return hexToBigInt(hex, opts)
123}
124
125export type BytesToBoolOpts = {
126 /** Size of the bytes. */

Callers 3

fromBytesFunction · 0.85
fromBytes.test.tsFile · 0.85
decodeNumberFunction · 0.85

Calls 3

assertSizeFunction · 0.85
bytesToHexFunction · 0.85
hexToBigIntFunction · 0.85

Tested by

no test coverage detected