Core
API v2.x
2

bitcount #

Counts the number of set bits (population counting) in a string.

[Redis documentation]


Query Syntax #

HTTP #

URL: http://kuzzle:7512/ms/_bitcount/<_id>[?start=<integer>&end=<integer>]
Method: GET

Other protocols #

{
  "controller": "ms",
  "action": "bitcount",
  "_id": "<key>"
  "start": <integer>,
  "end": <integer>
}

Arguments #

  • _id: key to evaluate

Optional: #

  • start: count starts at the provided offset
  • end: count ends at the provided offset

Response #

Returns the number of set bits.

{
  "requestId": "<unique request identifier>",
  "status": 200,
  "error": null,
  "controller": "ms",
  "action": "bitcount",
  "collection": null,
  "index": null,
  "result": 42
}