DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Bitwise Operation: Quickly Convert Binary Bit To Integer And Vice Versa Using Javascript Shell

11.07.2007
| 16644 views |
  • submit to reddit
        using JavaScript shell found at www.squarefree.com/shell/ , it's very easy to convert binary bit to integer and vice versa

convert integer to binary bit string
num = 1024
num.toString(2)

convert binary bit string to integer
parseInt('111', 2)