{"uid":"cap_AozugiDBLS4AkJ4bZIQth","slug":"bitwise-shift-left-right-a958e328","name":"Bitwise Shift (Left/Right)","description":"Shift a non-negative integer left or right by `amount` bits. A right shift is logical (fills with zeros). A left shift grows freely unless a `width` is given, in which case the result is masked to that width and the input must fit it. Returns decimal, hex and binary.","url":"https://bitwise.openverbs.com/v1/shift","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["value","amount","direction"],"properties":{"value":{"type":"string","pattern":"^\\d+$","description":"Non-negative integer as a decimal string."},"width":{"type":"integer","maximum":1024,"minimum":1,"description":"Optional bit width to mask a left shift to."},"amount":{"type":"integer","maximum":1024,"minimum":0,"description":"Number of bits to shift."},"direction":{"enum":["left","right"],"type":"string","description":"Shift direction."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_NZT80SX9tNNHh9g8qfqWG","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Shifts a non-negative integer left or right by a given number of bits, returning decimal, hex, and binary representations.","exampleAgentPrompt":"Shift the integer 255 left by 4 bits and give me the result in decimal, hex, and binary — no width mask needed.","exampleUseCases":[{"title":"Power-of-two multiplication via shift","prompt":"I need to multiply 37 by 8 using a left bit shift — can you shift 37 left by 3 bits and show me the decimal, hex, and binary result?"},{"title":"Extract upper nibble with right shift","prompt":"Right shift the value 0xF0 — that's 240 in decimal — by 4 bits so I can isolate the upper nibble, and give me the result in all three formats."},{"title":"Masked left shift for 16-bit register","prompt":"Left shift 5 by 10 bits and mask the result to 16 bits wide, so it fits in a 16-bit register — show me decimal, hex, and binary."}],"resultDescription":"Returns the shifted integer value in three representations: decimal (base 10), hexadecimal (base 16), and binary (base 2). For masked left shifts, the result is already truncated to the specified bit width.","failureModes":["Negative integer input — value must be a non-negative decimal string","Shift amount exceeds 1024 — maximum shift amount is 1024 bits","Bit width exceeds 1024 — maximum width is 1024 bits","Left shift input does not fit within the specified width — validation error","Non-numeric or non-integer string for value — pattern mismatch","Missing required fields (value, amount, direction) — schema validation error"],"whenToPreferThis":"Use this endpoint when you need to perform a logical left or right bit shift on an arbitrary-precision non-negative integer and want the result expressed in decimal, hex, and binary simultaneously. Prefer it over general-purpose code execution when you want a lightweight, purpose-built arithmetic operation without spinning up a compute environment. The optional width masking makes it ideal for simulating fixed-width registers (e.g., 8/16/32/64-bit).","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:41:21.274Z","isFirstParty":false}