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

  • submit to reddit
        using JavaScript shell found at , it's very easy to convert binary bit to integer and vice versa

convert integer to binary bit string
num = 1024

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