src/sliver.js
function longToBytes( long ) {
	// we want to represent the input as a 8-bytes array
	var byteArray = [ 0, 0, 0, 0, 0, 0, 0, 0 ];
	for (var index = 0; index < byteArray.length; index++) {
		var byte = long & 0xff;
		byteArray [ index ] = byte;
		long = ( ( long - byte ) / 256 );
	}
	return byteArray.reverse();
}
function longToBytes( long ) {
	// we want to represent the input as a 8-bytes array
	var byteArray = [ 0, 0, 0, 0, 0, 0, 0, 0 ];
	for (var index = 0; index < byteArray.length; index++) {
		var byte = long & 0xff;
		byteArray [ index ] = byte;
		long = ( ( long - byte ) / 256 );
	}
	return byteArray.reverse();
}
128 bit ids can generate up to 1    1    2    2    3    3   3 5    0    5    0    5    0    5   9 340282366920938463463374607431768211456 unique ids. By base-62 encoding them, we can shorten the length of the id to 22 places via http://stackoverflow.com/questions/8482309/converting-javascript-integer-to-byte-array-and-back