Search code examples
node.jsbufferbit

How to read a single bit buffer in node


How to read a single bit buffer in node like -

<Buffer 00>

Usage - To read the Boolean value stored in SQL table


Solution

  • You can access it by using Buffer API of nodejs

    if we assume a is the variable having the above value, it can converted to int in node using following:

    var value = a.readUIntLE()