{"uid":"cap_EPElc9hQrvHSTcG2WYIqp","slug":"hamming-weight-calculator-fa190736","name":"Hamming Weight Calculator","description":"Calculate the Hamming weight (number of 1s) in the binary representation of a non-negative integer.","url":"https://sovereign-x402-zeta.vercel.app/api/v1/sequence/hamming_weight?utm_source=zero.xyz","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","properties":{},"additionalProperties":true},"type":{"type":"string","const":"http"},"method":{"enum":["POST","PUT","PATCH"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Fy55dvZpY1VePk40DyosE","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates the Hamming weight (popcount) of a non-negative integer — i.e., the number of 1-bits in its binary representation.","exampleAgentPrompt":"What is the Hamming weight of 255? Count how many 1-bits are in its binary representation.","exampleUseCases":[{"title":"Verify bit-level checksum","prompt":"I need to know how many 1-bits are in the number 1023 — can you calculate the Hamming weight for me?"},{"title":"Population count for cryptography","prompt":"As part of a key analysis routine, compute the popcount (number of set bits) for the integer 4294967295."},{"title":"Bitwise algorithm debugging","prompt":"I'm debugging a bitwise algorithm and need to confirm the Hamming weight of the value 13 — how many 1s appear in its binary form?"}],"resultDescription":"Returns the count of 1-bits (popcount) in the binary representation of the provided non-negative integer as a numeric value.","failureModes":["Negative integer input may be rejected or produce undefined results","Non-integer or float inputs may return validation errors","Missing 'input' body field returns a 400-level error","Malformed JSON body returns a parse error","Service unavailability returns a 5xx error"],"whenToPreferThis":"Choose this endpoint when you need a simple, on-demand computation of the Hamming weight (popcount) of a non-negative integer without setting up local bit-manipulation logic. Useful in agentic workflows that require bit counting as a step in cryptographic analysis, data validation, or algorithm verification.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-13T12:39:12.768Z","isFirstParty":false,"canonicalSlug":"hamming-weight-calculator-fa190736"}