327jiw
Last Updated: February 25, 2016
·
3.561K
· tomgco
63fd35197fdef12ba2bea02a10723fce

2's Complement in Javascript

My message to checksum:

var d = 0x0a + 0x80 + 0x04 + 0x06 + 0x20 + 0xff + 0xff

Represented as Base 16:

(~d + 1 >>> 0).toString(16)

or Binary:

(~d + 1 >>> 0).toString(2)
Say Thanks
Respond

2 Responses
Add your response

3485
Me 180x180

This should have more likes, reminding me of good ol' times at CS 101.

over 1 year ago ·
17757
Shark 1

Perfect for UPB command checksums!

over 1 year ago ·