Skip to content

Instantly share code, notes, and snippets.

@pgriess
Created July 13, 2010 02:20
Show Gist options
  • Save pgriess/473365 to your computer and use it in GitHub Desktop.
Save pgriess/473365 to your computer and use it in GitHub Desktop.
var sys = require('sys');
var slice = function(b, off, len) {
var s = 7 - (off + len - 1);
b = b >>> s;
return b & ~(0xff << len);
};
sys.puts(slice(0x12, 3, 2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment